diff --git a/sys/net/gnrc/network_layer/ipv6/nib/_nib-internal.c b/sys/net/gnrc/network_layer/ipv6/nib/_nib-internal.c index 5c51b126169f6..b252c5de67908 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/_nib-internal.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/_nib-internal.c @@ -619,7 +619,9 @@ int _nib_get_route(const ipv6_addr_t *dst, gnrc_pktsnip_t *pkt, (void *)pkt); _nib_offl_entry_t *offl = _nib_offl_get_match(dst); - if (offl == NULL) { + if ((offl == NULL) || + /* give default route precedence over off-link PLEs */ + ((offl->mode == _PL) && !(offl->flags & _PFX_ON_LINK))) { _nib_dr_entry_t *router = _nib_drl_get_dr(); if ((router == NULL) && (offl == NULL)) { diff --git a/sys/net/gnrc/network_layer/ipv6/nib/_nib-router.c b/sys/net/gnrc/network_layer/ipv6/nib/_nib-router.c index 9b2bd14bc30a4..2a0646abbf60b 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/_nib-router.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/_nib-router.c @@ -102,6 +102,9 @@ static gnrc_pktsnip_t *_offl_to_pio(_nib_offl_entry_t *offl, { uint32_t now = (xtimer_now_usec64() / US_PER_MS) & UINT32_MAX; gnrc_pktsnip_t *pio; + gnrc_netif_t *netif = gnrc_netif_get_by_pid( + _nib_onl_get_if(offl->next_hop) + ); uint8_t flags = 0; uint32_t valid_ltime = (offl->valid_until == UINT32_MAX) ? UINT32_MAX : ((offl->valid_until - now) / MS_PER_SEC); @@ -111,7 +114,11 @@ static gnrc_pktsnip_t *_offl_to_pio(_nib_offl_entry_t *offl, DEBUG("nib: Build PIO for %s/%u\n", ipv6_addr_to_str(addr_str, &offl->pfx, sizeof(addr_str)), offl->pfx_len); - if (offl->flags & _PFX_ON_LINK) { + /* do not advertise as on-link if 6LN + * https://tools.ietf.org/html/rfc6775#section-6.1 otherwise the PIO will be + * ignored by other nodes (https://tools.ietf.org/html/rfc6775#section-5.4) + */ + if ((offl->flags & _PFX_ON_LINK) && !gnrc_netif_is_6ln(netif)) { flags |= NDP_OPT_PI_FLAGS_L; } if (offl->flags & _PFX_SLAAC) { diff --git a/sys/net/gnrc/network_layer/ipv6/nib/nib_pl.c b/sys/net/gnrc/network_layer/ipv6/nib/nib_pl.c index 27940320afafc..503f55cb1eaa3 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/nib_pl.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/nib_pl.c @@ -58,7 +58,12 @@ int gnrc_ipv6_nib_pl_set(unsigned iface, return 0; } gnrc_netif_acquire(netif); - if (!gnrc_netif_is_6ln(netif) && + /* prefixes within a 6Lo-ND-performing are typically off-link, the + * border router however should configure the prefix as on-link to only do + * address resolution towards the LoWPAN and not the upstream interface + * See https://github.com/RIOT-OS/RIOT/pull/10627 and follow-ups + */ + if ((!gnrc_netif_is_6ln(netif) || gnrc_netif_is_6lbr(netif)) && ((idx = gnrc_netif_ipv6_addr_match(netif, pfx)) >= 0) && (ipv6_addr_match_prefix(&netif->ipv6.addrs[idx], pfx) >= pfx_len)) { dst->flags |= _PFX_ON_LINK;