[riot-notifications] [RIOT-OS/RIOT] gnrc/netif: add gnrc_netif_ipv6_wait_for_global_address() (#16824)

Martine Lenders notifications at github.com
Thu Sep 16 14:43:40 CEST 2021


@miri64 requested changes on this pull request.



> +        unsigned count = 0;
+
+        /* subscribe to all interfaces */
+        while ((netif = gnrc_netif_iter(netif))) {
+            if (_has_global_addr(netif)) {
+                has_global = true;
+            }
+
+            _netif_bus_attach_and_subscribe_addr_valid(netif, &subs[count]);
+            ++count;

wrt https://github.com/RIOT-OS/RIOT/pull/16824#discussion_r710076990, maybe tying `count` and `netif` somewhat closer together using C-syntax will prevent future breakage:

```suggestion
        /* subscribe to all interfaces */
        for (unsigned count = 0;
             (netif = gnrc_netif_iter(netif));
             count++) {
            if (_has_global_addr(netif)) {
                has_global = true;
            }

            _netif_bus_attach_and_subscribe_addr_valid(netif, &subs[count]);
```

> +        unsigned count = 0;
+        while ((netif = gnrc_netif_iter(netif))) {
+            _netif_bus_detach(netif, &subs[count++]);
+        }

Same here

```suggestion
        for (unsigned count = 0;
             (netif = gnrc_netif_iter(netif));
             count++) {
            _netif_bus_detach(netif, &subs[count]);
        }
```

-- 
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/16824#pullrequestreview-756247221
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210916/7583877c/attachment.htm>


More information about the notifications mailing list