router: Apply updated values from RFC9096 (updates RFC4861) to RA/ND
authorPaul Donald <[email protected]>
Fri, 3 Oct 2025 14:33:49 +0000 (16:33 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Mon, 13 Oct 2025 07:52:41 +0000 (09:52 +0200)
https://datatracker.ietf.org/doc/html/rfc9096#section-3.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.h

index 19b007936e95286452215aeb04456aa1f61f0f93..6609f4355546f6a019daf64f0eac8c580cffbd86 100644 (file)
@@ -54,7 +54,18 @@ struct icmpv6_opt {
 
        Note: this is 16 bit Router Lifetime field in RA packets
 */
-#define RouterLifetime                                 65535
+/* RFC9096 defines recommended option lifetimes configuration values
+       ND_PREFERRED_LIMIT 2700
+       ND_VALID_LIMIT 5400
+
+       RFC9096  §3.4
+       CE routers SHOULD set the "Router Lifetime" of Router Advertisement
+       (RA) messages to ND_PREFERRED_LIMIT.
+
+       Note: while the RFC recommends SHOULD of ND_PREFERRED_LIMIT, this
+       define is used to cap values to a sane ceiling, i.e. ND_VALID_LIMIT.
+*/
+#define RouterLifetime                                 5400
 
 #define ND_RA_FLAG_PROXY               0x4
 #define ND_RA_PREF_HIGH                        (1 << 3)