Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Feb 2025 11:47:41 -0500
From:      Mark Johnston <markj@freebsd.org>
To:        Paul Vixie <paul@redbarn.org>
Cc:        freebsd-net@freebsd.org, Santiago Martinez <sm@codenetworks.net>, Jamie Landeg-Jones <jamie@catflap.org>
Subject:   Re: fibnum2.diff (Re: per-FIB socket binding)
Message-ID:  <Z7dcrX8rJ0OD1vEJ@nuc>
In-Reply-To: <2522290.jE0xQCEvom@localhost>
References:  <7772475.EvYhyI6sBW@dhcp-151.access.rits.tisf.net> <38589000.XM6RcZxFsP@dhcp-151.access.rits.tisf.net> <Z3v9R1YnDX9AWMUm@nuc> <2522290.jE0xQCEvom@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 18, 2025 at 05:16:07AM +0000, Paul Vixie wrote:
> this is the second fibnum patch, which replaces (doesn't add to) the first. 
> some blanks/tabs/margins lint was incidentally fixed, a few comments were 
> added, the API of several existing functions was changed, and some wrappers 
> were added to others. as explained inline below, this handles both TCP and UDP 
> listeners now. i did not add an SO_FIB operator nor shim SO_SETFIB since those 
> are independent of this socket-related work, needed to get path symmetry for 
> shell-related listeners like sshd.

The high-level changes seem to be:
- If a TCP listening socket's FIB is 0, then the FIB of incoming
  connections matched to that socket will be the FIB of the interface on
  which the initial SYN was received.
- When a socket is bound to a specific address, its FIB is set to the
  FIB of the interface which owns the address.

The logic seems reasonable to me.

The handling of the second point seems incomplete: it doesn't update the
FIB number stored in the socket itself.  Gleb and I talked a bit about
eliminating that field entirely so that there's only one source of
truth, and I think we'll eventually do that, but in the meantime,
in_pcbbind() needs to update so_fibnum as well.

> comments, questions, and especially testing results would be very welcome.

This patch doesn't apply to main.  Did you write it against stable/14?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Z7dcrX8rJ0OD1vEJ>