Skip to content

Commit

Permalink
ref: changed from regular if to #if
Browse files Browse the repository at this point in the history
  • Loading branch information
odiumuniverse committed Aug 1, 2024
1 parent c64a4db commit d967bd2
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions src/core/ipv4/autoip.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,17 @@ 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,
("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);
}
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);
#endif
#endif
}
}

/**
Expand All @@ -323,11 +327,15 @@ 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,
("autoip_network_changed_link_down(): stop autoip\n"));
autoip_stop(netif);
}
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);
#endif
#endif
}
}

/**
Expand Down

0 comments on commit d967bd2

Please sign in to comment.