From 38b384c71368e5e01b2d4ef75b039cc240439d0a Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Mon, 21 Sep 2015 19:15:07 +0200 Subject: [PATCH 1/2] 6lowpan: 6LBR should sent only one rtr adv On a 6lo interface the border router should only send one router advertisement with its new address as source address. --- .../network_layer/ipv6/netif/gnrc_ipv6_netif.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 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 09ea6d5af9..4201113d3f 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 @@ -109,16 +109,19 @@ static ipv6_addr_t *_add_addr_to_entry(gnrc_ipv6_netif_t *entry, const ipv6_addr if ((entry->flags & GNRC_IPV6_NETIF_FLAGS_ROUTER) && (entry->flags & GNRC_IPV6_NETIF_FLAGS_RTR_ADV)) { mutex_unlock(&entry->mutex); /* function below relocks mutex */ +#ifdef 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 #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); + if (!(entry->flags & GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN)) { + entry->rtr_adv_count = GNRC_NDP_MAX_INIT_RTR_ADV_NUMOF; + gnrc_ndp_router_retrans_rtr_adv(entry); } #endif mutex_lock(&entry->mutex); /* relock mutex */ From f3f4d61f93fc81b0aa600888ac76afa32749cfbd Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Mon, 21 Sep 2015 19:16:27 +0200 Subject: [PATCH 2/2] sixlowpan nd: 6LBR shouldn't send rtr sol over 6lo --- sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c b/sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c index 9e744c50ae..08f5db649c 100644 --- a/sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c +++ b/sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c @@ -51,9 +51,13 @@ void gnrc_sixlowpan_nd_init(gnrc_ipv6_netif_t *iface) iface->rtr_sol_count = 0; /* first will be sent immediately */ DEBUG("6lo nd: retransmit multicast rtr sol in 10 sec\n"); +#ifndef MODULE_GNRC_SIXLOWPAN_ND_BORDER_ROUTER _rtr_sol_reschedule(iface, GNRC_SIXLOWPAN_ND_RTR_SOL_INT); +#endif mutex_unlock(&iface->mutex); +#ifndef MODULE_GNRC_SIXLOWPAN_ND_BORDER_ROUTER gnrc_ndp_internal_send_rtr_sol(iface->pid, NULL); +#endif } void gnrc_sixlowpan_nd_mc_rtr_sol(gnrc_ipv6_netif_t *iface)