lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] SO_REUSEPORT removed on master branch


From: Joel Cunningham
Subject: Re: [lwip-devel] SO_REUSEPORT removed on master branch
Date: Thu, 16 Jul 2015 15:02:28 +0000 (GMT)

Additional follow up here:

I examined the implementation in the transport layer of SO_REUSEADDR and LwIP isn't behaving like a traditional BSD system does:

Traditionally BSD SO_REUSEADDR only allows binding to INADDR_ANY and additional unique IP addresses.  It does not allow binding to the same IP address (and port) multiple times, that behavior requires SO_REUSEPORT be enabled.

Our implementation is allowing binding to the same IP and port as long as all existing PCBs have SO_REUSEADDR also set.  This matches the BSD behavior of SO_REUSEPORT

This stack overflow page has a great overview of the different implementations:

http://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and-so-reuseport-how-do-they-differ-do-they-mean-t

Which implementation is LwIP attempting to follow?

Joel


On Jul 16, 2015, at 09:19 AM, Joel Cunningham <address@hidden> wrote:

Simon,

Thanks for the follow up.  I could go either way on the removing the define.  I've seen other network code besides my application that checks for SO_REUSEPORT with an #ifdef, so maybe that's a somewhat standard approach, but I agree the other socket options that are defined in LwIP (but not implemented) do set a precedent for leaving it.

For now, my application already has LwIP specific, so I can just adjust it to only use SO_REUSEADDR

Joel

On Jul 16, 2015, at 03:17 AM, Simon Goldschmidt <address@hidden> wrote:

Joel Cunningham wrote:
My question is, was it intentional to remove SO_REUSEPORT? If so, maybe we should
remove the define for SO_REUSEPORT as well

Yes, it was intentional, as SO_REUSEADDR is a standard thing whereas SO_REUSEPORT is a linux thing.
SO_REUSEPORT was implemeneted on socket layer but did nothing on IP layer. Therefore, I removed it on socket layer as well.
So you should now at least be informed that setsockopt(SO_REUSEPORT) fails.

We could remove the define to make people aware we don't support it, but there are other unimplemented sockopt defines as well...


Simon

_______________________________________________
lwip-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-devel
_______________________________________________
lwip-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]