From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202410 header.b=XAovyb3f; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 217165A061D for ; Tue, 12 Nov 2024 05:06:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1731384378; bh=rW0wDRzJGlhbwgQhhvb7dyQKFIW5Mq7rNC4H9t9b7do=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XAovyb3flAkBQ2h/J12zcxNG/DT5poq6iZtGFsZb3iyUUtHJPDJ+dvFrR14Nzfm5O Zxy7ScxgmJwmZlTCNDI30HZ9EAh0JUuAk2g/DZZCxFKr8k60jOl0tnN0huL340MkBM Li7znrQGf55L2/6rXEfGuHqfnW3Wa/CxKItemldVTCLnLMSU3aTLaG1CFjpdnF1FxB JGAh0R13bK3s1HLSpakcsFimm/6WzLEraVjn5lHVEWGm/VZj9WD/KF184XHLi9EF6n HYA2Sw/D0lb3tqPns5CkgB4V1lR2qIAS5aWedXvGY2BxJtAV050fzsGUcFxJMNGMsH o0N75xofEYSRg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XnXsQ2Rcfz4xSc; Tue, 12 Nov 2024 15:06:18 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 5/6] ndp: Make route lifetime a #define Date: Tue, 12 Nov 2024 15:06:17 +1100 Message-ID: <20241112040618.1804081-6-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241112040618.1804081-1-david@gibson.dropbear.id.au> References: <20241112040618.1804081-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: V5KKU7G5Q7XD6GKRPSPF5VZT2ZHBLVLE X-Message-ID-Hash: V5KKU7G5Q7XD6GKRPSPF5VZT2ZHBLVLE X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- ndp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ndp.c b/ndp.c index 5fda0f5..c5fbccf 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 = { -- 2.47.0