Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Nov 2022 17:09:07 -0700
From:      Gleb Smirnoff <glebius@freebsd.org>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        Sean Bruno <sbruno@freebsd.org>, "net@FreeBSD.org" <net@freebsd.org>
Subject:   Re: in_pcbbind_setup: wrong condition regarding INP_REUSEPORT ?
Message-ID:  <Y2RYI9Q29%2BFW86O7@FreeBSD.org>
In-Reply-To: <9037ac3d-8d8e-2d7d-cbdb-996a53613aca@FreeBSD.org>
References:  <ef09313c-14f4-01bc-b9c8-043f1c0ee830@FreeBSD.org> <896ee089-27ad-c98f-6bf9-4b05caf778fd@freebsd.org> <9037ac3d-8d8e-2d7d-cbdb-996a53613aca@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
  Andriy,

On Tue, Oct 04, 2022 at 02:46:51PM +0300, Andriy Gapon wrote:
A> Yes, that conditional.
A> I pointed out the part of it that does not make sense to me.
A> 
A> Also, in my tests SO_REUSEPORT does not actually allow to share a port.
A> Test scenario:
A> - create a UDP socket
A> - setsockopt(SO_REUSEPORT)
A> - bind the socket to a port and wild card address
A> - success
A> - now repeat the previous steps with the same port *under a different user id*
A> - bind fails

Sorry for late reply. The described behavior of SO_REUSEPORT is correct.
This is what SO_REUSEPORT did back in the original BSD stack and this is
what it does today in FreeBSD. 20+ years later Linux introduced a different
kinds of functionality under the same socket option name, hence the confusion.

I can't say much on the INP_REUSEPORT_LB check in the discussed code :(

-- 
Gleb Smirnoff



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