I have written a patch that calls them when an interface comes up / down. I have tested them successfully on an Olimex E407 and used this code in multiple projects, however I'd like to hear your comments about it.
Change: In lwipthread.c, replace
Code: Select all
if (current_link_status)
tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_up,
&thisif, 0);
else
tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_down,
&thisif, 0);
by
Code: Select all
if (current_link_status) {
tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_up,
&thisif, 0);
dhcp_start(&thisif);
} else {
tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_down,
&thisif, 0);
dhcp_stop(&thisif);
}
Best regards, Uli