<p></p>
<p><b>@miri64</b> requested changes on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16536#discussion_r682506059">sys/net/gnrc/routing/simple_subnets/simple_subnets.c</a>:</p>
<pre style='color:#555'>> + *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License v2.1. See the file LICENSE in the top level
+ * directory for more details.
+ */
+
+/**
+ * @defgroup    net_gnrc_simple_subnets Simple-Subnet auto-configuration
+ * @ingroup     net_gnrc
+ * @brief       Automatic configuration for cascading subnets
+ *
+ * About
+ * =====
+ *
+ * This module provides an automatic configuration for networks with a simple
+ * tree tolpology.
</pre>

⬇️ Suggested change
<pre style="color: #555">- * tree tolpology.
+ * tree topology.
</pre>


<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16536#discussion_r682506578">doc/doxygen/src/simple_subnets.puml</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,40 @@
+@startuml
</pre>
<p>Some inline doc on how to generate the SVG from this new (to RIOT) file format would be nice.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16536#discussion_r682508351">sys/net/gnrc/routing/simple_subnets/simple_subnets.c</a>:</p>
<pre style='color:#555'>> + * the process repeats until the bits of prefix are exhausted. (The smallest
+ * must still have a /64 prefix.)
</pre>
<p>I know you mean "smallest subnet" here. Nevertheless, it is confusing that 64 is the largest possible number ;-).</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16536#discussion_r682510642">sys/net/gnrc/routing/simple_subnets/simple_subnets.c</a>:</p>
<pre style='color:#555'>> + * The downstream router will send an otherwise empty router advertisement with only
+ * the Route Information Option set to the upstream network.
</pre>
<p>Not sure the terminology "empty router advertisement" is correct. Maybe</p>

⬇️ Suggested change
<pre style="color: #555">- * The downstream router will send an otherwise empty router advertisement with only
- * the Route Information Option set to the upstream network.
+ * The downstream router will send a router advertisement with only
+ * a Route Information Option included to the upstream network.
</pre>


<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16536#discussion_r682511596">sys/net/gnrc/routing/simple_subnets/simple_subnets.c</a>:</p>
<pre style='color:#555'>> +    gnrc_pktsnip_t *ext_opts = NULL;
+    const ipv6_addr_t *prefix = &pio->prefix;
+    uint32_t valid_ltime = byteorder_ntohl(pio->valid_ltime);
+    uint32_t pref_ltime = byteorder_ntohl(pio->pref_ltime);
+
+    /* create a subnet for each downstream interface */
+    unsigned subnets = gnrc_netif_numof() - 1;
+
+    const uint8_t prefix_len = pio->prefix_len;
+    uint8_t new_prefix_len;
+
+    if (subnets == 0) {
+        return;
+    }
+
+    new_prefix_len = prefix_len + 32 - __builtin_clz(subnets);
</pre>
<p>Some comment what you are doing here would be nice. My head spins at least.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16536#discussion_r682513022">sys/net/gnrc/routing/simple_subnets/simple_subnets.c</a>:</p>
<pre style='color:#555'>> +        /* 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);
</pre>
<p>??! Comment says something about interface index, but all I can see is the number of interfaces (which is called <code>subnets</code> here for some reason) and the prefix length.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16536#discussion_r682513645">sys/net/gnrc/routing/simple_subnets/simple_subnets.c</a>:</p>
<pre style='color:#555'>> +    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);
</pre>
<p>Doesn't this immediately overwrite the value from the two lines before?</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16536#discussion_r682514145">sys/net/gnrc/routing/simple_subnets/simple_subnets.c</a>:</p>
<pre style='color:#555'>> +        if (ext_opts == NULL) {
+            DEBUG("simple_subnets: No space left in packet buffer. Not adding RIO\n");
</pre>
<p>Does it make sense to send the RA in that case at all?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/16536#pullrequestreview-722138400">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYFD7G6GLZGXJSR6DQLT3ENFTANCNFSM46IAKR5Q">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email">Android</a>.<img src="https://github.com/notifications/beacon/ABE7WYGQZWQV4QBLN4P4GDTT3ENFTA5CNFSM46IAKR52YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOFMFPKIA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/16536#pullrequestreview-722138400",
"url": "https://github.com/RIOT-OS/RIOT/pull/16536#pullrequestreview-722138400",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>