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

Martine Lenders notifications at github.com
Wed Sep 11 23:33:01 CEST 2019


miri64 commented on this pull request.



> +    }
+    else if ((argc > 3) && (strcmp(argv[2], "add") == 0)) {
+        gnrc_netif_t *netif;
+        ipv6_addr_t addr = IPV6_ADDR_UNSPECIFIED;
+
+        if (ipv6_addr_from_str(&addr, argv[3]) == NULL) {
+            _usage_nib_abr(argv);
+            return 1;
+        }
+        /* check addr */
+        if (ipv6_addr_is_link_local(&addr)) {
+            printf("address %s must be global\n", argv[3]);
+            return 1;
+        }
+        if (((netif = gnrc_netif_get_by_ipv6_addr(&addr)) == NULL) ||
+            gnrc_netif_is_6lbr(netif)) {

(remember in C `((netif = gnrc_netif_get_by_ipv6_addr(&addr)) != NULL)` and `(netif = gnrc_netif_get_by_ipv6_addr(&addr))` are the same. The first just makes it more clear that a pointer is checked.

-- 
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#discussion_r323469387
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190911/7a64f745/attachment.htm>


More information about the notifications mailing list