From 499b5f030c2b72118bad516a102c6119e6036e17 Mon Sep 17 00:00:00 2001 From: Epagris Date: Tue, 23 Apr 2024 23:36:50 +0200 Subject: [PATCH] - EthIntf: filtering double link setting to the same state --- eth_interface.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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