From a60703e89991d23345ed929328001e19f5bc47e0 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 14 Nov 2024 14:33:07 +1100 Subject: ndp: Make route lifetime a #define Currently we open-code the lifetime of the route we advertise via NDP to be 65535s (the maximum). Change it to a #define. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- ndp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ndp.c b/ndp.c index fd512ae..09df8d6 100644 --- a/ndp.c +++ b/ndp.c @@ -33,6 +33,8 @@ #include "tap.h" #include "log.h" +#define RT_LIFETIME 65535 + #define RS 133 #define RA 134 #define NS 135 @@ -229,7 +231,7 @@ static void ndp_ra(const struct ctx *c, const struct in6_addr *dst) .icmp6_code = 0, .icmp6_hop_limit = 255, /* RFC 8319 */ - .icmp6_rt_lifetime = htons_constant(65535), + .icmp6_rt_lifetime = htons_constant(RT_LIFETIME), .icmp6_addrconf_managed = 1, }, .prefix_info = { -- cgit v1.2.3