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=202606 header.b=BpUYSghy; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id F2DE35A0627 for ; Thu, 02 Jul 2026 08:31:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1782973907; bh=ckUZcEn61ytNtAY+fp4dib8bSnUc1u7ZkVyf4cfp28Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BpUYSghyphUdpJ+YOZDz09kpAEX1aVdI3eWh43yw/feemCVFnb5H0smuBA/1aDxng 3EKNPs9jLm8s98a8OOhRkjVRr/UdGgzwP8Fz4po8u/WjCGYV7Q1I3je4OoN42TTRpP aFbr565vJTEzXZ+zqOqq4zUANiUYnlk6sr1ECEM6Q/JBDpSTCpgFRdj01ZQmG3R3EG qKV307XrfmPMnSY8EGiDVSJbDH8vkv4q/uk6mbeSY1s0A0GpceuJs4e9PKhdX92/42 yNTd4p8WDi+9zWs3q5JT4fDDN5zmPSdaBNyerdErIZoPM7luKOIGwfUhgW1Nrng0GG LzBcRkt6DG20Q== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4grRql239Sz58n3; Thu, 02 Jul 2026 16:31:47 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v4 10/13] conf: Remove unnecessary mode checks from conf_addr() Date: Thu, 2 Jul 2026 16:31:40 +1000 Message-ID: <20260702063143.676932-11-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260702063143.676932-1-david@gibson.dropbear.id.au> References: <20260702063143.676932-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 3DNOHEV5JM2MPAMZENUPSHLAQXK2YLVQ X-Message-ID-Hash: 3DNOHEV5JM2MPAMZENUPSHLAQXK2YLVQ 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: conf_addr() sets c->ip[46]no_copy_addrs conditional upon being in pasta mode. That sort of makes sense, since address copying is only a thing for pasta mode. However, setting the variables anyway is harmless, and arguably more logically consistent. If we had a way of copying addresses for passt mode (or some future mode), it would still be incorrect to do so in these circumstances. So, make the assignments unconditional. Signed-off-by: David Gibson --- conf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/conf.c b/conf.c index 3614776c..d1889e0c 100644 --- a/conf.c +++ b/conf.c @@ -1203,13 +1203,11 @@ static bool conf_addr(struct ctx *c, char *arg, uint8_t opt_n) c->ip4.addr = *inany_v4(&addr); c->ip4.prefix_len = prefix_len - 96; c->ip4.addr_fixed = true; - if (c->mode == MODE_PASTA) - c->ip4.no_copy_addrs = true; + c->ip4.no_copy_addrs = true; } else { c->ip6.addr = addr.a6; c->ip6.addr_fixed = true; - if (c->mode == MODE_PASTA) - c->ip6.no_copy_addrs = true; + c->ip6.no_copy_addrs = true; } return is_prefix; -- 2.55.0