diff --git a/eth_interface.c b/eth_interface.c index b4c0010..3c9af03 100644 --- a/eth_interface.c +++ b/eth_interface.c @@ -96,9 +96,10 @@ static ThreadReturnType task_ethintf(ThreadParamType param) { } break; case ETH_IIE_LINK_CHG_NOTIFY: { bool ls = event_data; - ethinf_set_link_state(intf, ls); + bool prev_ls = ethinf_get_link_state(intf); // get previous link state + ethinf_set_link_state(intf, ls); // set new link state - if (intf->dhcp != NULL) { + if ((intf->dhcp != NULL) && (ls != prev_ls)) { // no double start! if (ls) { // if link is on dhcp_start(intf->dhcp); } else { // if link is off