<p></p>
<p><b>@benpicco</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16672#discussion_r678988912">sys/net/gnrc/netif/gnrc_netif.c</a>:</p>
<pre style='color:#555'>> +#if IS_USED(MODULE_GNRC_SIXLOWPAN_CTX)
+static bool _ctx_match(const gnrc_sixlowpan_ctx_t *ctx,
+                       const ipv6_addr_t *prefix, uint8_t prefix_len)
+{
+    return (ctx != NULL) &&
+           (ctx->prefix_len == prefix_len) &&
+           (ipv6_addr_match_prefix(&ctx->prefix, prefix) >= prefix_len);
+}
+
+/* configure 6LoWPAN compression context */
+static void _update_6ctx(const ipv6_addr_t *prefix, uint8_t prefix_len,
+                         uint32_t valid)
+{
+    gnrc_sixlowpan_ctx_t *ctx = gnrc_sixlowpan_ctx_lookup_addr(prefix);
+    uint8_t cid = 0;
+
+    if (!_ctx_match(ctx, prefix, prefix_len)) {
+        /* While the context is a prefix match, the defined prefix within the
+         * context does not match => use new context */
+        ctx = NULL;
+    }
+    else {
+        cid = ctx->flags_id & GNRC_SIXLOWPAN_CTX_FLAGS_CID_MASK;
+    }
+    /* find first free context ID */
+    if (ctx == NULL) {
+        while (((ctx = gnrc_sixlowpan_ctx_lookup_id(cid)) != NULL) &&
+               !_ctx_match(ctx, prefix, prefix_len)) {
+            cid++;
+        }
+    }
+    if (cid < GNRC_SIXLOWPAN_CTX_SIZE) {
+        DEBUG("GNRC util: add compression context %u for prefix %s/%u\n", cid,
+              ipv6_addr_to_str(addr_str, prefix, sizeof(addr_str)),
+              prefix_len);
+        gnrc_sixlowpan_ctx_update(cid, (ipv6_addr_t *)prefix, prefix_len,
+                                  valid / (60 * MS_PER_SEC),
+                                  true);
+    }
+}
+#else
+static void _update_6ctx(const ipv6_addr_t *prefix, uint8_t prefix_len,
+                         uint32_t valid)
+{
+    (void)prefix;
+    (void)prefix_len;
+    (void)valid;
+}
+#endif
</pre>
<p>Are those used anywhere else?</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/16672#discussion_r678988912">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYFBGMU3CJHOPK6EHUTT2EOBDANCNFSM5A2EDGWQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABE7WYE6K6CJ4KMNELWCCFLT2EOBDA5CNFSM5A2EDGW2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOFLE7QDQ.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/16672#discussion_r678988912",
"url": "https://github.com/RIOT-OS/RIOT/pull/16672#discussion_r678988912",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>