1
0
mirror of https://passt.top/passt synced 2024-12-22 13:45:32 +00:00

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 <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson 2024-11-14 14:33:07 +11:00 committed by Stefano Brivio
parent 36c070e6e3
commit a60703e899

4
ndp.c
View File

@ -33,6 +33,8 @@
#include "tap.h" #include "tap.h"
#include "log.h" #include "log.h"
#define RT_LIFETIME 65535
#define RS 133 #define RS 133
#define RA 134 #define RA 134
#define NS 135 #define NS 135
@ -229,7 +231,7 @@ static void ndp_ra(const struct ctx *c, const struct in6_addr *dst)
.icmp6_code = 0, .icmp6_code = 0,
.icmp6_hop_limit = 255, .icmp6_hop_limit = 255,
/* RFC 8319 */ /* RFC 8319 */
.icmp6_rt_lifetime = htons_constant(65535), .icmp6_rt_lifetime = htons_constant(RT_LIFETIME),
.icmp6_addrconf_managed = 1, .icmp6_addrconf_managed = 1,
}, },
.prefix_info = { .prefix_info = {