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=OrG4TrHq; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id D16C85A0271 for ; Thu, 02 Jul 2026 08:31:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1782973907; bh=rTDG4mXF37F/0nZ6gsGNJMGXjT8FLDnbD0n/GEfb430=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OrG4TrHq4TPrekQKocXuJlc7zU2ndnm7MR2/Svv83BscMIDsSY6GkBOb2pBjrxkqS Puam8cPnSqJJFljMvNuZlgjkeJBzAZyoesMdP+egOInobtWczJw4cb331b33hsoBw/ grrGPL5KSFsAB3PNz1OnIgzhxHT1FXB0S7l4WbkXmj6OCeVN1V3RzPu4pIHpbeQMrS tRuM/GJhb0jvceAHoMdydviIuNO79ZesaL5OKLldYBFrXIv2L+/rvbIL04UrqsYQPS ic5iwNPyNCi4KZBdGR/WAZleHJQeUq7mq6yRl6F2iFE6iQzNDTMOfDJmmcObvKGBHR +pvkufSScByMA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4grRql0kjYz58mt; Thu, 02 Jul 2026 16:31:47 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v4 02/13] conf: Use parameter instead of global in conf_nat() Date: Thu, 2 Jul 2026 16:31:32 +1000 Message-ID: <20260702063143.676932-3-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: 7BCISXF3WF2U6M6FLA36Y6MNG5DMB5V3 X-Message-ID-Hash: 7BCISXF3WF2U6M6FLA36Y6MNG5DMB5V3 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_nat() takes a parameter @arg for the argument it's parsing. However on error we print instead optarg, the getopt() global. This happens to be the same thing at the time of the call, but it's not the right way to get to it. Signed-off-by: David Gibson --- conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.c b/conf.c index 4755a9f4..6ab8efec 100644 --- a/conf.c +++ b/conf.c @@ -1049,7 +1049,7 @@ static void conf_nat(const char *arg, struct in_addr *addr4, !IN4_IS_ADDR_MULTICAST(addr4)) return; - die("Invalid address to remap to host: %s", optarg); + die("Invalid address to remap to host: %s", arg); } /** -- 2.55.0