Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Nov 2013 12:26:23 +0000
From:      Joe Holden <lists@rewt.org.uk>
To:        freebsd-net@freebsd.org
Subject:   Re: [PATCH] SO_REUSEADDR and SO_REUSEPORT behaviour
Message-ID:  <529887EF.8090009@rewt.org.uk>
In-Reply-To: <CAPBZQG29BEJJ8BK=gn%2Bg_n5o7JSnPbsKQ-=3=6AkFOxzt%2B=wGQ@mail.gmail.com>
References:  <CAPBZQG29BEJJ8BK=gn%2Bg_n5o7JSnPbsKQ-=3=6AkFOxzt%2B=wGQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 29/11/2013 12:04, Ermal Luçi wrote:
> Hello,
>
> since SO_REUSEADDR and SO_REUSEPORT are supposed to allow two daemons to
> share the same port and possibly listening ip, you would expect if you bind
> two daemon with such options to same port to see the same traffic on both!
>
> This is not the case today.
> Only multicast sockets seem to have the behaviour of broadcasting the data
> to all sockets sharing the same properties through these options!
>
> The patch at [1] implements/corrects the behaviour for UDP sockets.
> Is there anything to be corrected in that patch?
> Why it has not been provided there before?
> Can it be committed to the tree?
> Any extra security checks for jails needed there?
>
>
> [1]
> https://github.com/pfsense/pfsense-tools/blob/master/patches/RELENG_10_0/udp_SO_REUSEADDR%2BPORT.diff
>
Have you added support for TCP as well?  IMO the correct behaviour is 
the functioning of the Linux support added in 3.9 
(https://lwn.net/Articles/542629/) - TCP would be much more useful than 
UDP (think high load web servers etc)

I'm not sure what the correct handling would be for UDP though, is it 
not inefficient to send copies of the same data to all listeners? Would 
round-robin distribution be usable?

TCP I guess doesn't matter as the listener can just accept().



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