aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-11-14 14:33:07 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-11-14 19:00:34 +0100
commita60703e89991d23345ed929328001e19f5bc47e0 (patch)
tree145b54a0f26a9075a1015d29d169d9d548c09562
parent36c070e6e320b97bb4761e29c934f5f269e06b35 (diff)
downloadpasst-a60703e89991d23345ed929328001e19f5bc47e0.tar
passt-a60703e89991d23345ed929328001e19f5bc47e0.tar.gz
passt-a60703e89991d23345ed929328001e19f5bc47e0.tar.bz2
passt-a60703e89991d23345ed929328001e19f5bc47e0.tar.lz
passt-a60703e89991d23345ed929328001e19f5bc47e0.tar.xz
passt-a60703e89991d23345ed929328001e19f5bc47e0.tar.zst
passt-a60703e89991d23345ed929328001e19f5bc47e0.zip
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>
-rw-r--r--ndp.c4
1 files changed, 3 insertions, 1 deletions
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 = {