From: Paul Donald <newt...@gmail.com>

Follow-up fix for bc9d317f2921ae6b529f2c9f8de79b75992e206f

https://www.rfc-editor.org/rfc/rfc4861#page-44

Signed-off-by: Paul Donald <newt...@gmail.com>
---
 src/router.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/router.c b/src/router.c
index 3890c0b..a1a7829 100644
--- a/src/router.c
+++ b/src/router.c
@@ -603,6 +603,13 @@ static int send_router_advert(struct interface *iface, 
const struct in6_addr *fr
                                valid_lt = iface->dhcp_leasetime;
                }
 
+               if (preferred_lt > valid_lt) {
+                       /* RFC4861 ?? 6.2.1
+                       This value [AdvPreferredLifetime] MUST NOT be larger 
than AdvValidLifetime.
+                       */
+                       preferred_lt = valid_lt;
+               }
+
                if (minvalid > valid_lt)
                        minvalid = valid_lt;
 
-- 
2.44.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to