Skip to content

Commit

Permalink
change if statements in autoip.c to fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kamendov-maxim committed Jul 16, 2024
1 parent 73fcf72 commit 93c1bde
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/core/ipv4/autoip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand All @@ -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
}
}

Expand Down

0 comments on commit 93c1bde

Please sign in to comment.