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=202602 header.b=VRCf7xXI; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 846655A0265 for ; Fri, 15 May 2026 10:25:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1778833476; bh=2eJo0PtXLCLZAFbMUl9xSHHmH2Hi5meGfIeLzz+xjoE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VRCf7xXIrFChcLEb+qvRvqBcK9G3jVwrEpCUIbx/6/qJZIdN+P72mec0SS8HM+66y 37AVaC0ZIvgDTijQypnP2OQGjBNET/r/9au5k55Ru7vaIPo7zpSdl+gHqT+FisIdZK XR2yTWBPUU6eIrJR/e84Q3JgTFzFrblTeIRIvcGB4YBv153ntHCSO4PI/MERevv5/A Q2DtzDP30VCJOsugv4G/5i96hljHVyn3tUweRa5bGCwcq6j12bwJwfCavcBsxsBpR9 NqY9W4C0pXhplGCVWPdT0zjYxz02uvMS2Cc2dqGn2hmUIU/SFI+BRByPxC5VHgYZ2i LoCcUptz+7M9g== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gH0c43NRJz4wDK; Fri, 15 May 2026 18:24:36 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 2/2] fwd_rule: Allow parsing * as a forwarding address Date: Fri, 15 May 2026 18:24:34 +1000 Message-ID: <20260515082434.630175-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515082434.630175-1-david@gibson.dropbear.id.au> References: <20260515082434.630175-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: N5BS7W7KX3L7HA34YYKIV57REPYE4BWT X-Message-ID-Hash: N5BS7W7KX3L7HA34YYKIV57REPYE4BWT 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: j.d03@cpc.cx, 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: In our output in various places, we use "*", or sometimes "[*]" to indicate a dual stack unspecified address: that is a case where we listen on both 0.0.0.0 and ::. However we don't currently allow the same syntax when specifying forwarding rules on the command line. A * address can be indirectly specified by omitting the address entirely, but for consistency allow an explicit "*" or "[*]" as well. Signed-off-by: David Gibson --- fwd_rule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fwd_rule.c b/fwd_rule.c index cb37a990..04a0101d 100644 --- a/fwd_rule.c +++ b/fwd_rule.c @@ -709,7 +709,9 @@ void fwd_rule_parse(char optname, bool del, const char *optarg, p++; } - if (!inany_pton(p, &addr_buf)) + if (strcmp(p, "*") == 0) + addr = NULL; + else if (!inany_pton(p, &addr_buf)) die("Bad forwarding address '%s'", p); } } else { -- 2.54.0