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=ELfXS38B; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id C5D695A0265 for ; Tue, 07 Apr 2026 05:16:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1775531792; bh=rh3rGrutWvI3Sj3svfRdPYLQwfQrXP2gGkI38QC9g7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ELfXS38BRePFSMBp8kMs3tJZxDp53Xyn7K0JmmCglWTGBjzCZ0N0pIcjahbTDvgum LjHKGPksDFtzxQElqi/ac4P4XHCHtOrAzV7/nQHZm3bTXMJ91UZJoNHpXHeosWsNad yHqIXbmjovIapiiwqzWHVtkb3Coa6cRuxXG/OQ2sOVKaHiXaXCVojwn5JDczR2PRIy mDzILVK2stfG5fSoemXXViavTw2VB/oEvOJ4CoG2N/7DRDSPM8q8UldOU8GHfKE0kr XvuZp8/F/MYd76tcx6n1vBNjbljfk6esWd4jE3EY0+0dUFpGILLetmXoAcG6Iq2qmL s7K+8Dk/iX96Q== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4fqWZ84x0kz4wL4; Tue, 07 Apr 2026 13:16:32 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 03/18] conf: Move first pass handling of -[TU] next to handling of -[tu] Date: Tue, 7 Apr 2026 13:16:15 +1000 Message-ID: <20260407031630.2457081-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260407031630.2457081-1-david@gibson.dropbear.id.au> References: <20260407031630.2457081-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: AOCRNCRAVF2YNEPGTUJ7TWXG4L6BI35J X-Message-ID-Hash: AOCRNCRAVF2YNEPGTUJ7TWXG4L6BI35J 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: The forwarding options -[tTuU] can't be fully handled in our first pass over the command line options, they need to wait until the second, once we know more about the interface configuration. However, we do need stub handling, so they don't cause an error. For historical reasons the -[TU] options are handled a fair way apart from the -[tu] options. Move them next to each other for clarity. Signed-off-by: David Gibson --- conf.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/conf.c b/conf.c index 7d718f91..f3b36bb6 100644 --- a/conf.c +++ b/conf.c @@ -2024,6 +2024,12 @@ void conf(struct ctx *c, int argc, char **argv) c->one_off = true; break; + case 'T': + case 'U': + if (c->mode != MODE_PASTA) + die("-%c is for pasta mode only", name); + + /* fall through */ case 't': case 'u': /* Handle these later, once addresses are configured */ @@ -2064,13 +2070,6 @@ void conf(struct ctx *c, int argc, char **argv) die("Cannot use DNS address %s", optarg); } break; - case 'T': - case 'U': - if (c->mode != MODE_PASTA) - die("-%c is for pasta mode only", name); - - /* Handle properly later, once addresses are configured */ - break; case 'h': usage(argv[0], stdout, EXIT_SUCCESS); break; -- 2.53.0