[riot-notifications] [RIOT-OS/RIOT] gnrc_netif: centralize device-type-specific functions (#10524)

Martine Lenders notifications at github.com
Mon Jan 7 16:01:17 CET 2019


> > The ABRO MUST be included in all RA messages in the case when RAs are used to propagate information between routers (as described in Section 8.2).
> 
> which sounds like an `assert` is appropriate. I'm not really able to asset what side effects it would have when multihop prefix is not deactivated explicitly.

The particular line line of code we are talking about is not 6LN-specific. We should make sure however, that non-6LR don't disseminate a prefix it received without multihop prefix dissemination. So how about 

```diff
diff --git a/sys/net/gnrc/network_layer/ipv6/nib/nib.c b/sys/net/gnrc/network_layer/ipv6/nib/nib.c
index 17bb9b9..abdb3e4 100644
--- a/sys/net/gnrc/network_layer/ipv6/nib/nib.c
+++ b/sys/net/gnrc/network_layer/ipv6/nib/nib.c
@@ -1415,7 +1415,8 @@ static uint32_t _handle_pio(gnrc_netif_t *netif, const icmpv6_hdr_t *icmpv6,
     if (pio->flags & NDP_OPT_PI_FLAGS_A) {
         _auto_configure_addr(netif, &pio->prefix, pio->prefix_len);
     }
-    if ((pio->flags & NDP_OPT_PI_FLAGS_L) || gnrc_netif_is_6lr(netif)) {
+    if ((pio->flags & NDP_OPT_PI_FLAGS_L) ||
+        (gnrc_netif_is_6lr(netif)) && (abr != NULL)) {
         _nib_offl_entry_t *pfx;
 
         if (pio->valid_ltime.u32 == 0) {
@@ -1442,8 +1443,9 @@ static uint32_t _handle_pio(gnrc_netif_t *netif, const icmpv6_hdr_t *icmpv6,
         if ((pfx = _nib_pl_add(netif->pid, &pio->prefix, pio->prefix_len,
                                valid_ltime, pref_ltime))) {
 #if GNRC_IPV6_NIB_CONF_MULTIHOP_P6C
-            assert(abr != NULL);    /* should have been set in _handle_abro() */
-            _nib_abr_add_pfx(abr, pfx);
+            if (abr != NULL) {
+                _nib_abr_add_pfx(abr, pfx);
+            }
 #endif  /* GNRC_IPV6_NIB_CONF_MULTIHOP_P6C */
             if (pio->flags & NDP_OPT_PI_FLAGS_L) {
                 pfx->flags |= _PFX_ON_LINK;
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10524#issuecomment-451962637
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190107/1c5f3bdb/attachment.html>


More information about the notifications mailing list