From 6f2d90a95cc26f5308ba1e4a85229ddd43d4d8ef Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Sat, 19 Sep 2015 21:29:35 +0200 Subject: [PATCH] 6lowpan nd: send rtr adv on new address --- .../network_layer/ipv6/netif/gnrc_ipv6_netif.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c b/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c index 06c053f819..09ea6d5af9 100644 --- a/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c +++ b/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c @@ -105,15 +105,22 @@ static ipv6_addr_t *_add_addr_to_entry(gnrc_ipv6_netif_t *entry, const ipv6_addr } else { if (!ipv6_addr_is_link_local(addr)) { -#ifdef MODULE_GNRC_NDP_ROUTER - /* New prefixes MAY allow the router to retransmit up to - * GNRC_NDP_MAX_INIT_RTR_ADV_NUMOF unsolicited RA - * (see https://tools.ietf.org/html/rfc4861#section-6.2.4) */ +#if defined(MODULE_GNRC_NDP_ROUTER) || defined(MODULE_GNRC_SIXLOWPAN_ND_ROUTER) if ((entry->flags & GNRC_IPV6_NETIF_FLAGS_ROUTER) && (entry->flags & GNRC_IPV6_NETIF_FLAGS_RTR_ADV)) { - entry->rtr_adv_count = GNRC_NDP_MAX_INIT_RTR_ADV_NUMOF; mutex_unlock(&entry->mutex); /* function below relocks mutex */ +#ifdef MODULE_GNRC_NDP_ROUTER + /* New prefixes MAY allow the router to retransmit up to + * GNRC_NDP_MAX_INIT_RTR_ADV_NUMOF unsolicited RA + * (see https://tools.ietf.org/html/rfc4861#section-6.2.4) */ + entry->rtr_adv_count = GNRC_NDP_MAX_INIT_RTR_ADV_NUMOF; gnrc_ndp_router_retrans_rtr_adv(entry); +#elif defined(MODULE_GNRC_SIXLOWPAN_ND_ROUTER) + if (entry->flags & GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN) { + gnrc_ndp_internal_send_rtr_adv(entry->pid, &tmp_addr->addr, + NULL, false); + } +#endif mutex_lock(&entry->mutex); /* relock mutex */ } #endif