DHCP client issues
Posted: Sun Mar 29, 2015 7:24 pm
Since ChibiOS 2.6 I have had issues with the lwIP DHCP client not working properly. I believe this is the case because the lwip functions dhcp_start() and dhcp_stop() are never called in the lwIP binding thread.
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
by
Best regards, Uli
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