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=oyUUmSZr; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id E18CA5A0269 for ; Wed, 01 Jul 2026 07:32:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1782883921; bh=icg4HFCDVfpnaRLoy43vwQ6qbOhgtC/BszvaJ7f4Ksc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oyUUmSZrkkVfu39LkR7SXt4eGH3cGjDIvFepBwHr4d1GiOUhEwMCBaRTPqRsvyquA 1YHwrpjstgSRtZhuV/FgtU4hIcxE3r9JnMuf/JMJnwZ3c9tQh36ib8rTeG6qCjRAvl sDqR3vXwKp2AJ74nCHlPJKa4xFtXJ32EyoZWOS4yvbRfk1Oa0AuUYXy+ri0OtmOXq3 p0XbYAVTBOe2QBrCLYl0iguRzzMgBV0cpPUdYQedolr4LaMh6GlIhkVWNahqlFQOPk ASLFwuKCbdpEwFymADhQn2T6/XR3ir6Z9xbuvq+3VZ9wKaajz54kcJBb4xPSqjDopw NEIvnE2TsbqRw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gqpYF0LJbz58dT; Wed, 01 Jul 2026 15:32:01 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v2 02/13] conf: Use parameter instead of global in conf_nat() Date: Wed, 1 Jul 2026 15:31:44 +1000 Message-ID: <20260701053155.1219264-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260701053155.1219264-1-david@gibson.dropbear.id.au> References: <20260701053155.1219264-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: JR736MUIAETQJU2CEEDO46RCZBKGJIXO X-Message-ID-Hash: JR736MUIAETQJU2CEEDO46RCZBKGJIXO 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.54.0