Problem when enabling/disabling NAT on esp-idf 4.3.2
Posted: Thu Jun 02, 2022 1:14 pm
I'm trying to enable NAT by using lwip from esp-idf, but the function to do it seems that isn't working properly.
The first image shows the "if" that must work to execute the ip_napt_init function where the necessary structures are initialized, but here this 'if' is never executed, so the NAT is never enabled. This function do not returns a error when the process did not work properly, so I will know that it didn't work only when I try to disable the NAT, in this case, the ip_napt_deinit is called (more below in the same image).
The second image is the code from ip_napt_init
The third image is ip_napt_deinit function, the board is crashing because it tries to free a memory that wasn't allocate before.
The first image shows the "if" that must work to execute the ip_napt_init function where the necessary structures are initialized, but here this 'if' is never executed, so the NAT is never enabled. This function do not returns a error when the process did not work properly, so I will know that it didn't work only when I try to disable the NAT, in this case, the ip_napt_deinit is called (more below in the same image).
The second image is the code from ip_napt_init
The third image is ip_napt_deinit function, the board is crashing because it tries to free a memory that wasn't allocate before.