[riot-notifications] [RIOT-OS/RIOT] gnrc_ipv6_nib: auto-configure downstream subnets (#16536)

benpicco notifications at github.com
Wed Aug 4 15:12:05 CEST 2021


@benpicco commented on this pull request.



> +    if (new_prefix_len > 64) {
+        DEBUG("simple_subnets: can't split /%u into %u subnets\n", prefix_len, subnets);
+        return;
+    }
+
+    while ((downstream = gnrc_netif_iter(downstream))) {
+        ipv6_addr_t new_prefix;
+
+        if (downstream == upstream) {
+            continue;
+        }
+
+        /* create subnet by adding interface index */
+        new_prefix.u64[0].u64 = byteorder_ntohll(prefix->u64[0]);
+        new_prefix.u64[0].u64 |= (uint64_t)subnets-- << (63 - prefix_len);
+        new_prefix.u64[0] = byteorder_htonll(new_prefix.u64[0].u64);

already added in 3074fe0def6a1cee12aaf63e51e6ca4439f9687c

-- 
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/16536#discussion_r682601442
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210804/16ab580d/attachment.htm>


More information about the notifications mailing list