[riot-notifications] [RIOT-OS/RIOT] shell/sc_gnrc_ipv6_nib: extend for ABR (#10951)

benpicco notifications at github.com
Wed Sep 11 20:09:35 CEST 2019


benpicco commented on this pull request.

I don't know much about the details here, but as nobody else has looked into this PR yet, I thought I'll give it a try.

Just tested this with `examples/gnrc_networking` and `radvd` on a raspberry pi, where it prints:

```
2019-09-11 19:39:50,148 - INFO #  nib abr
2019-09-11 19:39:50,151 - INFO # fd00:1:2:3:a:b:c:d v0 expires 65394min
```

(Really, 45 days?)

When I do `nib abr del fd00:1:2:3:a:b:c:d`, the address immediately shows up again afterwards, ~~but I guess this is to be expected as the advertisement is still going on.~~
It still shows up after `nib abr del` when I shutdown the raspi too.

This adds 536 bytes of ROM on samr21-xpro with `examples/gnrc_networking`.

Code looks good, just noticed a minor thing where you have the `#ifdef` logic reversed and print the wrong usage output.

Oh, and Travis thinks you should clean up a coccinelle warning in `sc_gnrc_ipv6_nib.c` when you are touching that file.

> @@ -49,7 +57,11 @@ int _gnrc_ipv6_nib(int argc, char **argv)
 
 static void _usage(char **argv)
 {
+#if GNRC_IPV6_NIB_CONF_MULTIHOP_P6C
     printf("usage: %s {neigh|prefix|route|help} ...\n", argv[0]);

This case and the `#else` case should be swapped.

> @@ -50,8 +55,39 @@ void gnrc_ipv6_nib_abr_del(const ipv6_addr_t *addr)
     _nib_abr_remove(addr);
     mutex_unlock(&_nib_mutex);
 }
+#endif  /* GNRC_IPV6_NIB_CONF_6LBR */
+
+bool gnrc_ipv6_nib_abr_iter(void **state, gnrc_ipv6_nib_abr_t *entry)
+{
+    _nib_abr_entry_t *abr = *state;
+
+    mutex_lock(&_nib_mutex);
+    while ((abr = _nib_abr_iter(abr)) != NULL) {
+        if (!ipv6_addr_is_unspecified(&abr->addr)) {
+            memcpy(&entry->addr, &abr->addr, sizeof(abr->addr));

```suggestion
            memcpy(&entry->addr, &abr->addr, sizeof(entry->addr));
```
just to be save ;)

-- 
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/10951#pullrequestreview-286955742
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190911/861accb1/attachment-0001.htm>


More information about the notifications mailing list