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=S84NVBZ1; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id A88CD5A026D for ; Tue, 07 Apr 2026 05:16:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1775531792; bh=towxst9nNagdPAOMXW9FkKPgrHjOdwBZYakJ5iGLrSw=; h=From:To:Cc:Subject:Date:From; b=S84NVBZ19RX1VqdMpDsoHvNWNac1NnYaBGHqBh/u+GJSTvF0IqskKf06iHPEwzkqB DT0n9FIU816d6wn6sPT7awzpVrB6IEihLObPsuwInr4pcRzlwRy0nvvN/QZuOk0Us4 ppTPv2n8gVVc2kSOJHu06T7OtwnOI9btZ3gbpH35/N5/1wVYnYSW1AWKJcilHPCd8x KPoeQV6jc5Bl4ANteyXlt8gVT41gBgEQkUkqAI53ojn6d9EISpAYqXalnEHjqXt8W3 dP5Ue4EVDesh3gudppHpPBkWtCWAIyce0kSgluGgYqaJtVLyrx7+wT0TmPmrG9u6P3 qepXQMjFXwarQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4fqWZ84WlSz4wKQ; Tue, 07 Apr 2026 13:16:32 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 00/18] Rework forwarding option parsing Date: Tue, 7 Apr 2026 13:16:12 +1000 Message-ID: <20260407031630.2457081-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.53.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: PE2PE6AKK6W76G23WEKHYJVFSTOHN2UK X-Message-ID-Hash: PE2PE6AKK6W76G23WEKHYJVFSTOHN2UK 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: This series makes a number of significant reworks to how we process forwarding options (-t, -u, -T and -U) in passt & pasta. This is largely motivated by moving towards being able to share this code with a configuration update tool. However, along the way it also enables some forwarding configurations that were technically possible with the forwarding table but couldn't be specified on the command line, in particular bug 180. There is still a bunch of work needed to make the parsing code truly shareable with pesto, but this is a solid start. David Gibson (18): conf: Split parsing of port specifiers from the rest of -[tuTU] parsing conf: Simplify handling of default forwarding mode conf: Move first pass handling of -[TU] next to handling of -[tu] doc: Consolidate -[tu] option descriptions for passt and pasta conf: Permit -[tTuU] all in pasta mode fwd: Better split forwarding rule specification from associated sockets fwd_rule: Move forwarding rule formatting conf: Pass protocol explicitly to conf_ports_range_except() fwd: Split rule building from rule adding fwd_rule: Move rule conflict checking from fwd_rule_add() to caller fwd: Improve error handling in fwd_rule_add() conf: Don't be strict about exclusivity of forwarding mode conf: Rework stepping through chunks of port specifiers conf: Rework checking for garbage after a range conf: Move "all" handling to port specifier conf: Allow user-specified auto-scanned port forwarding ranges conf: Move SO_BINDTODEVICE workaround to conf_ports() conf: Don't pass raw commandline argument to conf_ports_spec() Makefile | 10 +- conf.c | 541 ++++++++++++++++++++++++++--------------------------- fwd.c | 190 ++++++------------- fwd.h | 21 +-- fwd_rule.c | 132 +++++++++++++ fwd_rule.h | 15 ++ passt.1 | 214 +++++++-------------- 7 files changed, 542 insertions(+), 581 deletions(-) create mode 100644 fwd_rule.c -- 2.53.0