diff --git a/sys/net/gnrc/network_layer/ndp/router/gnrc_ndp_router.c b/sys/net/gnrc/network_layer/ndp/router/gnrc_ndp_router.c index ab01e8b8ae61c00b8a78460b01f154992f043d45..ce23cc7a7c4eef4d913acca33d01419082993ef7 100644 --- a/sys/net/gnrc/network_layer/ndp/router/gnrc_ndp_router.c +++ b/sys/net/gnrc/network_layer/ndp/router/gnrc_ndp_router.c @@ -90,6 +90,7 @@ static void _send_rtr_adv(gnrc_ipv6_netif_t *iface, ipv6_addr_t *dst) mutex_lock(&iface->mutex); fin = (iface->adv_ltime == 0); + assert((iface->min_adv_int != 0) && (iface->max_adv_int != 0)); interval = genrand_uint32_range(iface->min_adv_int, iface->max_adv_int); if (!fin && !((iface->flags | GNRC_IPV6_NETIF_FLAGS_ROUTER) && (iface->flags | GNRC_IPV6_NETIF_FLAGS_RTR_ADV))) { diff --git a/sys/net/gnrc/network_layer/sixlowpan/nd/router/gnrc_sixlowpan_nd_router.c b/sys/net/gnrc/network_layer/sixlowpan/nd/router/gnrc_sixlowpan_nd_router.c index ca44f44fa0b7d4b0b29a9b0794ece8f4290f7ae5..673d1f2296b79cf5148dcd2ea8baeeb35e60af64 100644 --- a/sys/net/gnrc/network_layer/sixlowpan/nd/router/gnrc_sixlowpan_nd_router.c +++ b/sys/net/gnrc/network_layer/sixlowpan/nd/router/gnrc_sixlowpan_nd_router.c @@ -112,8 +112,15 @@ void gnrc_sixlowpan_nd_router_set_rtr_adv(gnrc_ipv6_netif_t *netif, bool enable) if (enable && (gnrc_ipv6_netif_add_addr(netif->pid, &all_routers, 128, GNRC_IPV6_NETIF_ADDR_FLAGS_NON_UNICAST) != NULL)) { + mutex_lock(&netif->mutex); netif->flags |= GNRC_IPV6_NETIF_FLAGS_RTR_ADV; netif->adv_ltime = GNRC_IPV6_NETIF_DEFAULT_ROUTER_LTIME; +#ifdef MODULE_GNRC_NDP_ROUTER + /* for border router these values have to be initialized, too */ + netif->max_adv_int = GNRC_IPV6_NETIF_DEFAULT_MAX_ADV_INT; + netif->min_adv_int = GNRC_IPV6_NETIF_DEFAULT_MIN_ADV_INT; +#endif + mutex_unlock(&netif->mutex); } else { netif->flags &= ~GNRC_IPV6_NETIF_FLAGS_RTR_ADV;