public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Jon Maloy <jmaloy@redhat.com>
Cc: passt-dev@passt.top, Gerwim Feiken <info@gerwim.nl>,
	Bug C <bugchaser123@proton.me>
Subject: Re: [PATCH 0/2] udp: Don't share preserved source ports with foreign sockets
Date: Thu, 03 Dec 2026 01:23:58 +0100 (CET)	[thread overview]
Message-ID: <20261203012357.483a07b8@elisabeth> (raw)
In-Reply-To: <20261201235202.2474521-1-jmaloy@redhat.com>

On Tue,  1 Dec 2026 18:52:00 -0500
Jon Maloy <jmaloy@redhat.com> wrote:

> For UDP flows initiated by the guest, we preserve the guest's source
> port on the host. If another socket already holds that port, we either
> fail to bind the flow socket, dropping the flow (e.g. with Podman's
> rootlessport publishing the same port, bug 223), or, if that socket
> also uses SO_REUSEADDR, end up sharing an identical 4-tuple with it, so
> that replies get delivered to the wrong socket (e.g. several passt
> instances in the same namespace talking to the same DNS resolver).
> 
> Patch 1, by Gerwim Feiken, binds those flow sockets exclusively, and
> falls back to a port picked by the kernel if the bind fails.
> 
> Patch 2 keeps sharing the port if it's held by one of our own listening
> sockets, so that we still preserve the source port for ports we
> forward, which matters e.g. for BitTorrent's DHT.
> 
> Tested in three ways:
> * With a foreign socket holding the port (fallback, reply received)
> * With pasta forwarding the port itself (port preserved)
> * With two instances run by the same user using the same source
>   port (no stolen replies).
> 
> Link: https://bugs.passt.top/show_bug.cgi?id=223
> 
> Gerwim Feiken (1):
>   udp: Don't share a preserved source port with other sockets
> 
> Jon Maloy (1):
>   udp: Keep sharing source ports we forward ourselves

Series applied, thanks, and welcome Gerwim to the git log!

-- 
Stefano

  parent reply	other threads:[~2026-12-03  0:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 23:52 Jon Maloy
2026-12-01 23:52 ` [PATCH 1/2] udp: Don't share a preserved source port with other sockets Jon Maloy
2026-12-01 23:52 ` [PATCH 2/2] udp: Keep sharing source ports we forward ourselves Jon Maloy
2026-12-03  0:23 ` Stefano Brivio [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-12-01 23:37 [PATCH 0/2] udp: Don't share preserved source ports with foreign sockets Jon Maloy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261203012357.483a07b8@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=bugchaser123@proton.me \
    --cc=info@gerwim.nl \
    --cc=jmaloy@redhat.com \
    --cc=passt-dev@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).