[PATCH 1/2] IAPP: Set SO_REUSEPORT on listening socket

Jouni Malinen j at w1.fi
Sun Nov 22 11:02:20 PST 2015


On Mon, Nov 16, 2015 at 04:56:42AM +0200, Petko Bordjukov wrote:
> On нд, 2015-11-15 at 19:16 +0200, Jouni Malinen wrote:
> > SO_REUSEPORT is a pretty recent addition. Wouldn't this break build
> > with older header files? As such, this should probably be protected
> > with #ifdef SO_REUSEPORT or something similar.
> 
> Yes, SO_REUSEPORT is indeed a fairly new addition to Linux. I could
> protect it with an ifdef or I could just use SO_REUSEADDR. If I
> understand correctly there is little difference between the two with
> regards to multicast (with the exception of the UID checking for
> SO_REUSEPORT).
> 
> Having said that, I have not tested SO_REUSEADDR yet. I will and
> depending on the results will either submit a new version with
> SO_REUSEADDR or one with an ifdef around the setsockopt invocation.

I think I'm fine with either. Taken into account the current
implementation has been there for years, this cannot really be a
critical issue and using SO_REUSEPORT with ifdef should be fine.

> > It sounds like it would be safe to ignore the error and continue to
> > get the existing behavior.
> 
> Yes, it would be safe to continue. Should I make it just log a
> MSG_WARNING and carry on instead?

Yes.
 
-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list