From 93c1bde3215cf4e229c71d11f36a0f2b57f8c40f Mon Sep 17 00:00:00 2001 From: kamendov-maxim Date: Tue, 16 Jul 2024 21:03:33 +0300 Subject: [PATCH] change if statements in autoip.c to fix compiler warnings --- src/core/ipv4/autoip.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/core/ipv4/autoip.c b/src/core/ipv4/autoip.c index 461a00533..499b1d7fd 100644 --- a/src/core/ipv4/autoip.c +++ b/src/core/ipv4/autoip.c @@ -302,12 +302,16 @@ autoip_network_changed_link_up(struct netif *netif) { struct autoip *autoip = netif_autoip_data(netif); - if (autoip && (autoip->state != AUTOIP_STATE_OFF) && !LWIP_DHCP_AUTOIP_COOP) { - LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, + if (autoip && (autoip->state != AUTOIP_STATE_OFF)) { + #ifdef LWIP_DHCP_COOP + #if !LWIP_DHCP_COOP + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_network_changed_link_up(): start acd\n")); - autoip->state = AUTOIP_STATE_CHECKING; - /* Start acd check again for the last used address */ - acd_start(netif, &autoip->acd, autoip->llipaddr); + autoip->state = AUTOIP_STATE_CHECKING; + /* Start acd check again for the last used address */ + acd_start(netif, &autoip->acd, autoip->llipaddr); + #endif + #endif } } @@ -323,10 +327,14 @@ autoip_network_changed_link_down(struct netif *netif) { struct autoip *autoip = netif_autoip_data(netif); - if (autoip && (autoip->state != AUTOIP_STATE_OFF) && LWIP_DHCP_AUTOIP_COOP) { - LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, + if (autoip && (autoip->state != AUTOIP_STATE_OFF)) { + #ifdef LWIP_DHCP_AUTOIP_COOP + #if LWIP_DHCP_AUTOIP_COOP + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_network_changed_link_down(): stop autoip\n")); - autoip_stop(netif); + autoip_stop(netif); + #endif + #endif } }