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=202510 header.b=g8oAM/Sv; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id EA6195A0619 for ; Wed, 19 Nov 2025 06:23:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202510; t=1763529779; bh=pK7jRZxDLzFbjxMcCsP+pGH7poub5gZ1a23LYojZAIc=; h=From:To:Cc:Subject:Date:From; b=g8oAM/SvDQTTX10d9YnOjcmbNr6ScCYYuiiweh0y1/O4Y9Ht2OS7nVubKTOtGUir0 F5W8WLDK2smsuWCqa+ZV9B+c39wQVu4tI/8Hdqwe86ntbnNf3RFAGjcIyhBfmijasO Z5bo94hDdCYDmspiSXoKkxYVLTHeyDPUja0SBOCzxTMeOoirsFe+EdVIbtKfm1p+F6 PNaFE0uMPsZR6tdsGvK2wfkdSPNscik6hCtNNZ77um9iF/3O9z2FhNPrk2+cPz4pWb dFXR8F5/bG2PDGnYpjQVkhjs16Asrm6gcPW3sAAD13/ieQuTtuphnoboX4grP0bjNN O6ceJjl4GEHQA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dB8yC3Grmz4wGT; Wed, 19 Nov 2025 16:22:59 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v4 0/9] Reduce differences between inbound and outbound socket binding Date: Wed, 19 Nov 2025 16:22:48 +1100 Message-ID: <20251119052257.3004500-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.51.1 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: TQEUZYWP6VOZM2YDHFUOODDPDVAJJDNS X-Message-ID-Hash: TQEUZYWP6VOZM2YDHFUOODDPDVAJJDNS 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 is based on my series fixing bug 176 (regression in auto forwarding). The fact that outbound forwarding sockets are bound to the loopback address, whereas inbound forwarding sockets are (by default) bound to the unspecified address leads to some unexpected differences between the paths setting up each of them. An idea for tackling bug 100 suggested a different approach which will also reduce some of those differences and allow more code to be shared between the two paths. I've since discovered that this approach doesn't help for bug 100, but I think it's still worthwhile for other reasons. Patches 1..7/9 are cleanups which shouldn't change behaviour, and I think are ready to merge. 8/9 and 9/9 introduce behavioural changes, but I've made the case for them in the patch comments. v4: - Add cleanup patch removing unused structure field - Rebase, fixing conflicts with Laurent's changes - A bunch of spelling and other cosmetic fixes - Clarify relation to bug 100 and bug 113 v3: - A number of additional fixes covering the handling of IPV6_V6ONLY sockopt - Assorted trivial changes v2: - Some rearrangements and rewordings for clarity David Gibson (9): flow: Remove bogus @path field from flowside_sock_args inany: Let length of sockaddr_inany be implicit from the family util, flow, pif: Simplify sock_l4_sa() interface tcp: Merge tcp_ns_sock_init[46]() into tcp_sock_init_one() udp: Unify some more inbound/outbound parts of udp_sock_init() udp: Move udp_sock_init() special case to its caller util: Fix setting of IPV6_V6ONLY socket option tcp, udp: Remove fallback if creating dual stack socket fails tcp, udp: Bind outbound listening sockets by interface instead of address conf.c | 4 +- flow.c | 22 +++---- icmp.c | 3 +- inany.h | 17 ++++++ pif.c | 27 ++------- pif.h | 2 +- tcp.c | 164 +++++++++++++++++++-------------------------------- tcp.h | 5 +- tcp_splice.c | 5 +- udp.c | 102 +++++++++++++++----------------- udp.h | 5 +- util.c | 76 ++++++++++++++++++++---- util.h | 8 ++- 13 files changed, 221 insertions(+), 219 deletions(-) -- 2.51.1