Skip to content

mptcp: add REUSEADDR/REUSEPORT/V6ONLY setsockopt support

Florian Westphal mptcp netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: use mptcp setsockopt function for SOL_SOCKET on mptcp socketsnet/mptcp/protocol.c net/socket.c+15 -10 replies
2/3mptcp: add REUSEADDR/REUSEPORT supportnet/mptcp/protocol.c+32 -10 replies
3/3mptcp: support IPV6_V6ONLY setsockoptnet/mptcp/protocol.c+30 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/3] mptcp: add REUSEADDR/REUSEPORT/V6ONLY setsockopt support

restarting an mptcp-patched sshd yields following error:

sshd: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
sshd: error: setsockopt IPV6_V6ONLY: Operation not supported
sshd: error: Bind to port 22 on :: failed: Address already in use.
sshd: fatal: Cannot bind any address.

This series adds support for the needed setsockopts:

First patch skips the generic SOL_SOCKET handler for MPTCP:
in mptcp case, the setsockopt needs to alter the tcp socket, not the mptcp parent socket.

Second patch adds minimal SOL_SOCKET support: REUSEPORT and REUSEADDR. Rest is still handled by the generic SOL_SOCKET code.

Last patch adds IPV6ONLY support. This makes ipv6 work for openssh:
It creates two listening sockets, before this patch, binding the ipv6 socket will fail because the port is already bound by the ipv4 one.

Florian Westphal (3):
net: use mptcp setsockopt function for SOL_SOCKET on mptcp sockets
mptcp: add REUSEADDR/REUSEPORT support
mptcp: support IPV6_V6ONLY setsockopt

 net/mptcp/protocol.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 net/socket.c         | 13 ++++++++++-
 2 files changed, 76 insertions(+), 1 deletion(-)