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=Rc0TgRvR; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id C0C5B5A026D for ; Fri, 03 Jul 2026 05:54:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1783050892; bh=rTDG4mXF37F/0nZ6gsGNJMGXjT8FLDnbD0n/GEfb430=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rc0TgRvRhwSxiz81JWT0QHJqB7ljW00NC+i+LBrwfHp5CwSv6Xv+VdupHJKgZ/u8w owH0wTHDb8k+8Wi53r+XAZloWD2V6piBDUL/RGRcAUhIh5cGO6j8HCgCoQvdx7Xm8I DxBaROp4+9415Rj3z1Lp5UIrz4rYD8p90tDxQTlRUGHVReNK2SMZaXBndepDRR8oWJ AF8JvHe05DI3w70gp601Yx46AdBwkFS/twbcB5Z8uhqWL0ViZc3mPTY60Z6lqRVFGu JV0KbImrpVH9vuXxmcL4jAkkFRtI7o7Bk10PWxANMLi0uxfhwjSf7McCkG0hl0obUy pA2OgLemsloEQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gs0JD1fQxz4xTV; Fri, 03 Jul 2026 13:54:52 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v5 02/13] conf: Use parameter instead of global in conf_nat() Date: Fri, 3 Jul 2026 13:54:34 +1000 Message-ID: <20260703035445.888394-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260703035445.888394-1-david@gibson.dropbear.id.au> References: <20260703035445.888394-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 5MSZXWNODUPQ74SQ73VL477UU2L2J46Y X-Message-ID-Hash: 5MSZXWNODUPQ74SQ73VL477UU2L2J46Y 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