diff --git a/src/core/ipv4/autoip.c b/src/core/ipv4/autoip.c index 24c4ddaa099cbbeaafa3d9348568d856d713a06e..caf5216dfa03642896b2ab37c201639b2ff58c60 100644 --- a/src/core/ipv4/autoip.c +++ b/src/core/ipv4/autoip.c @@ -365,10 +365,9 @@ autoip_stop(struct netif *netif) u32_t autoip_tmr_tick(void) { - struct netif *netif = netif_list; + struct netif *netif = NULL; u32_t tick = 0; - - while (netif != NULL) { + NETIF_FOREACH(netif) { struct autoip *autoip = netif_autoip_data(netif); if ((autoip != NULL) && (autoip->ttw > 0)) { if ((autoip->state == AUTOIP_STATE_PROBING) || @@ -376,7 +375,6 @@ autoip_tmr_tick(void) SET_TMR_TICK(tick, autoip->ttw); } } - netif = netif->next; } LOWPOWER_DEBUG(("%s tmr tick: %u\n", __func__, tick)); diff --git a/src/core/ipv4/igmp.c b/src/core/ipv4/igmp.c index 95baed5c74593de13f5feec108953cb862084264..15b0f01673e8fda16cf8a351a8cb011e7267b3e5 100644 --- a/src/core/ipv4/igmp.c +++ b/src/core/ipv4/igmp.c @@ -673,10 +673,14 @@ igmp_tmr(void) u32_t igmp_tmr_tick(void) { - struct netif *netif; + struct netif *netif = NULL; u32_t tick = 0; - - NETIF_FOREACH(netif) { +#ifdef LOSCFG_NET_CONTAINER + NETIF_FOREACH(netif, get_root_net_group()) +#else + NETIF_FOREACH(netif) +#endif + { struct igmp_group *group = netif_igmp_data(netif); while (group != NULL) { if (group->timer > 0) { @@ -685,7 +689,6 @@ igmp_tmr_tick(void) group = group->next; } } - LOWPOWER_DEBUG(("%s tmr tick: %u\n", __func__, tick)); return tick; } diff --git a/src/core/ipv6/dhcp6.c b/src/core/ipv6/dhcp6.c index 9236646e8a1a5d3b1a2c92a0605981001a599633..49ec8180bb4c136e7ff4d77b5a27c29dc947b001 100644 --- a/src/core/ipv6/dhcp6.c +++ b/src/core/ipv6/dhcp6.c @@ -830,7 +830,12 @@ dhcp6_tmr_tick() struct netif *netif = NULL; u32_t tick = 0; /* loop through netif's */ - NETIF_FOREACH(netif) { + #ifdef LOSCFG_NET_CONTAINER + NETIF_FOREACH(netif, get_root_net_group()) +#else + NETIF_FOREACH(netif) +#endif + { struct dhcp6 *dhcp6 = netif_dhcp6_data(netif); /* only act on DHCPv6 configured interfaces */ if ((dhcp6 != NULL) && (dhcp6->request_timeout > 0)) { diff --git a/src/core/ipv6/mld6.c b/src/core/ipv6/mld6.c index fb001bf78dd19596d1926bb0bc1c653d32339142..6715acaad357f1d7cb86ef9301fbdedd011e45e0 100644 --- a/src/core/ipv6/mld6.c +++ b/src/core/ipv6/mld6.c @@ -535,10 +535,15 @@ mld6_tmr(void) u32_t mld6_tmr_tick(void) { - struct netif *netif = netif_list; + struct netif *netif = NULL; u32_t tick = 0; - while (netif != NULL) { +#ifdef LOSCFG_NET_CONTAINER + NETIF_FOREACH(netif, get_root_net_group()) +#else + NETIF_FOREACH(netif) +#endif + { struct mld_group *group = netif_mld6_data(netif); while (group != NULL) { if (group->timer > 0) { @@ -546,7 +551,6 @@ mld6_tmr_tick(void) } group = group->next; } - netif = netif->next; } LOWPOWER_DEBUG(("%s tmr tick: %u\n", __func__, tick)); diff --git a/src/core/ipv6/nd6.c b/src/core/ipv6/nd6.c index 2497d34912a3a8c8de0591fad4dabafd6e97de16..1f4079f294bb814d970817196524dabcd6608c36 100644 --- a/src/core/ipv6/nd6.c +++ b/src/core/ipv6/nd6.c @@ -1219,7 +1219,12 @@ nd6_tmr_tick(void) } /* Process our own addresses, updating address lifetimes and/or DAD state. */ - NETIF_FOREACH(netif) { +#ifdef LOSCFG_NET_CONTAINER + NETIF_FOREACH(netif, get_root_net_group()) +#else + NETIF_FOREACH(netif) +#endif + { for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; ++i) { u8_t addr_state; #if LWIP_IPV6_ADDRESS_LIFETIMES