router: Apply updated values from RFC8319 (updates RFC4861) to RA/ND
authorPaul Donald <[email protected]>
Fri, 3 Oct 2025 14:33:41 +0000 (16:33 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Mon, 13 Oct 2025 07:52:35 +0000 (09:52 +0200)
https://www.rfc-editor.org/rfc/rfc8319#section-4

Signed-off-by: Paul Donald <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/225
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/router.c
src/router.h

index 079a5d183fe81e80e8e7368d55a867f15f3b16ae..e9b4372d5b4987e7f8f02c535207531f184b0aeb 100644 (file)
@@ -379,8 +379,8 @@ static uint32_t calc_ra_lifetime(struct interface *iface, uint32_t maxival)
 
        if (lifetime > 0 && lifetime < maxival)
                lifetime = maxival;
-       else if (lifetime > 9000)
-               lifetime = 9000;
+       else if (lifetime > RouterLifetime)
+               lifetime = RouterLifetime;
 
        return lifetime;
 }
index 0444da8329a88c1b17ed27efb537f3992728ba87..19b007936e95286452215aeb04456aa1f61f0f93 100644 (file)
@@ -32,8 +32,29 @@ struct icmpv6_opt {
 
 #define MaxInitialRtrAdvInterval       16
 #define MaxInitialRtAdvs               3
-#define MaxRtrAdvInterval              1800
-#define MinRtrAdvInterval              3
+/* RFC8319 §4
+       This document updates §4.2 and 6.2.1 of [RFC4861] to change
+       the following router configuration variables.
+
+       In §6.2.1, inside the paragraph that defines
+       MaxRtrAdvInterval, change 1800 to 65535 seconds.
+
+       In §6.2.1, inside the paragraph that defines
+       AdvDefaultLifetime, change 9000 to 65535 seconds.
+*/
+#define MaxRtrAdvInterval                              65535
+#define MinRtrAdvInterval                              3
+#define AdvDefaultLifetime                             65535
+/* RFC8319 §4
+       This document updates §4.2 and 6.2.1 of [RFC4861] to change
+       the following router configuration variables.
+
+       In §4.2, inside the paragraph that defines Router Lifetime,
+       change 9000 to 65535 seconds.
+
+       Note: this is 16 bit Router Lifetime field in RA packets
+*/
+#define RouterLifetime                                 65535
 
 #define ND_RA_FLAG_PROXY               0x4
 #define ND_RA_PREF_HIGH                        (1 << 3)