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=bAY+0Mnc; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id A5B915A026E for ; Thu, 02 Jul 2026 02:59:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1782953982; bh=icg4HFCDVfpnaRLoy43vwQ6qbOhgtC/BszvaJ7f4Ksc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bAY+0Mncw6592UYcmIHQdTtO9zw0kL4OZAoFBeoMWsRFfDj2f9mnKZBNSYpbY762w fOaENBHeTlFQ0t47y9QqNxwO+4OTCv2MP8qrwJieLgKKrGIlbgT+VEdasFv79YVCMQ me8DtK714T8uIHPtGrzhXVtdHMaKX74TEfGYixNwYT49CI2jNIoioPpw4rJbT6xF8Y 66lhFv1rYmArvtE9NNw4TTyXGjIxPLH9wln3YpVr0mtglUBTCJfsnmFZUapbexGKat REP4ZZbyRgRYDYVMu1+kXS+Se6KV8v3IEWcC2jITQzFcw3UmHvpupXJXDUXuinEvYG N0z0CWSDR4u1Q== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4grJSZ0gsVz4wJq; Thu, 02 Jul 2026 10:59:42 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v3 02/13] conf: Use parameter instead of global in conf_nat() Date: Thu, 2 Jul 2026 10:58:50 +1000 Message-ID: <20260702005901.2010709-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260702005901.2010709-1-david@gibson.dropbear.id.au> References: <20260702005901.2010709-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: GUMPITKTUZVZMDVPMIHYKXYNMBOIP3AW X-Message-ID-Hash: GUMPITKTUZVZMDVPMIHYKXYNMBOIP3AW 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