support SocketProtocol for both the client and server
This adds a new option called SocketProtocol, to allow the users to change the socket protocol, the 3rd parameter of the socket syscall.
A typical use-case is to properly enable MPTCP [1] support: on Linux, to support it, apps have to create a stream socket with the IPPROTO_MPTCP (262) protocol, that's it:
socket(AF_INET(6), SOCK_STREAM, IPPROTO_MPTCP)
So now, to get MPTCP support with SSH commands, the SocketProtocol option can be set to 262, e.g.
$ ssh -o SocketProtocol=262 my-server
Or by adding SocketProtocol 262 in ssh_config or sshd_config.
Other protocols on other OS can then also be used that way, it is not Linux specific as #335 was.
Please note that so far, only workarounds could be used to enable MPTCP support with SSH on Linux, e.g. the LD_PRELOAD technique to change the behaviour of the socket() call. Such workaround has limitations:
- On the server side:
- The service to launch the ssh daemon -- something that is usually not modified -- needs to be overridden, it's not just a config to set in the
sshd_configfile. - Also, some sysadmins don't allow
LD_PRELOADtechniques, because all TCP sockets created by the service will be modified without sshd's knowledge.
- The service to launch the ssh daemon -- something that is usually not modified -- needs to be overridden, it's not just a config to set in the
- On the client side:
- Each command (ssh, scp, git, etc.) needs to be executed with
LD_PRELOADbeing set. That's maybe OK for occasional commands, less for regular ones, or for GUI applications. - A
ProxyCommandoption could be used -- e.g. set tossh -W %h:%p -l %r -p %p %h-- but it is not great because it needs to be adapted for each host to pass some options, e.g. use v4/v6 only, etc.
- Each command (ssh, scp, git, etc.) needs to be executed with
Hopefully this new option can help users to enable MPTCP support on both the client and server side.