[riot-notifications] [RIOT-OS/RIOT] gnrc_ipv6_nib: handle route information option (#16568)

Martine Lenders notifications at github.com
Mon Aug 2 15:15:39 CEST 2021


@miri64 requested changes on this pull request.



> @@ -215,6 +215,52 @@ static gnrc_pktsnip_t *_build_ext_opts(gnrc_netif_t *netif,
     return ext_opts;
 }
 
+/* Sending a RA with ltime = 0 causes the router to be removed from the
+ * default router list, but options are still parsed.
+ * This allows us to add downstream subnets that should be routed through
+ * this router, but the router is not an upstream / default router for
+ * this link. */
+static gnrc_pktsnip_t *_build_final_ext_opts(gnrc_netif_t *netif)
+{
+    gnrc_pktsnip_t *ext_opts = NULL;
+    _nib_offl_entry_t *entry = NULL;
+
+    if (!IS_USED(MODULE_GNRC_IPV6_NIB_RIO) ||
+        !IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_RIO_IN_LAST_RA)) {
+        return NULL;

So the final RA will now have no options at all when `!IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_RIO_IN_LAST_RA)`?

> @@ -228,7 +274,9 @@ static void _snd_ra(gnrc_netif_t *netif, const ipv6_addr_t *dst,
 {
     gnrc_pktsnip_t *ext_opts = NULL;
 
-    if (!final) {
+    if (final) {

I think another check for `IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_RIO_IN_LAST_RA)` is needed here.

> @@ -138,6 +138,17 @@ extern "C" {
 #endif
 #endif
 
+/**
+ * @brief   Include a Route Information Option for subnets
+ *          on other interfaces in the last Router Advertisement
+ *          generated by @ref gnrc_ipv6_nib_change_rtr_adv_iface
+ *
+ *          Requires the `gnrc_ipv6_nib_rio` module.
+ */
+#ifndef CONFIG_GNRC_IPV6_NIB_RIO_IN_LAST_RA
+#define CONFIG_GNRC_IPV6_NIB_RIO_IN_LAST_RA          0

```suggestion
#define CONFIG_GNRC_IPV6_NIB_ONLY_RIO_IN_LAST_RA     0
```

?

-- 
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/16568#pullrequestreview-720186334
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210802/623abda5/attachment.htm>


More information about the notifications mailing list