So when I detect a cable disconnect and reconnect I want to restart LWIP. I have noticed that several things appear to go wrong, when trying to restart LWIP.
1. httpd has no way to close the port. Hence even with an lwip_init() it still thought port was used. 2. When restarting timeouts with sys_timeouts_init() the next_timeout variable was not set to NULL. which cause the sys_timeout_abs() to sit in for loop forever. 3. in mem_init() I zero the memory pool as I was getting some double free errors. I think this might have helped mask many other issues in the code. It seems that much of the code assumes the processor will be reset and does not fully initializes variables in the init() routines. I am sure I did not find all the problems. I was wondering how much of the code assumed on reset the memory (variables) are reset to zero by default? For example current_timeout_due_time and tcpip_tcp_timer_active... Thanks Trampas
_______________________________________________ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users