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=nVXCRX0t; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 1D3965A026D for ; Fri, 26 Jun 2026 09:10:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1782457808; bh=Q71/tl9lnyI3U2dX9DAeZNfXh225f50nPaZ5zV8sQSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nVXCRX0tw9Eo51dxSp5y/bLfftQXFeI5tnGMz4KzsGl+kfrgMEXwkdOpaXtM3ixYa xuu/f4X01ecJ+BvfzW8teNcvrKBHK5R89H7xSRfeUGM/mEcZfhogg1XwC2ykTVJVVu aPF7+pqW7ShRArm0DTH5EptdGjCUH1kgz4kWr70ca0aELyMdlaijUvQXcLiWxQdeO7 hvy0IiTOi+DpCdl7TmPWQaqkfe0OkuCQE6PbMgI6+7DhjQO6JxGPC3oWtdRyZ3MWI0 nzfPm3N+Sj+1KiN54oyE6yUq/hyaFQdbTaGrcObnbSvRqncHgTG58q8nhNLWbQfdJY p4PBTIejI+1vg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gmmym3ZTHz4wc3; Fri, 26 Jun 2026 17:10:08 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 02/12] conf: Use parameter instead of global in conf_nat() Date: Fri, 26 Jun 2026 17:09:53 +1000 Message-ID: <20260626071003.3472194-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260626071003.3472194-1-david@gibson.dropbear.id.au> References: <20260626071003.3472194-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 3QOKC2H6XH55WOCH2XBCLOD66SWLX2KH X-Message-ID-Hash: 3QOKC2H6XH55WOCH2XBCLOD66SWLX2KH 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