mirror of
https://github.com/martin-ger/esp_wifi_repeater.git
synced 2026-07-28 04:06:57 +00:00
Calling ip_napt_init() after loading portmap table wipes it out
This commit is contained in:
+3
-4
@@ -4238,20 +4238,19 @@ void ICACHE_FLASH_ATTR user_init()
|
||||
os_printf("\r\n\r\nWiFi Repeater %s starting\r\n\nrunning rom %d\r", ESP_REPEATER_VERSION, rboot_get_current_rom());
|
||||
|
||||
// Load config
|
||||
if (config_load(&config) == 0)
|
||||
uint8_t config_state = config_load(&config);
|
||||
ip_napt_init(config.max_nat, config.max_portmap);
|
||||
if (config_state == 0)
|
||||
{
|
||||
// valid config in FLASH, can read portmap table
|
||||
blob_load(0, (uint32_t *)ip_portmap_table, sizeof(struct portmap_table) * IP_PORTMAP_MAX);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// clear portmap table
|
||||
blob_zero(0, sizeof(struct portmap_table) * IP_PORTMAP_MAX);
|
||||
}
|
||||
|
||||
ip_napt_init(config.max_nat, config.max_portmap);
|
||||
|
||||
if (config.tcp_timeout != 0)
|
||||
ip_napt_set_tcp_timeout(config.tcp_timeout);
|
||||
if (config.udp_timeout != 0)
|
||||
|
||||
Reference in New Issue
Block a user