support SocketProtocol for both the client and server #547
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:So now, to get MPTCP support with SSH commands, the
SocketProtocol
option can be set to 262, e.g.Or by adding
SocketProtocol 262
inssh_config
orsshd_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 thesocket()
call. Such workaround has limitations:sshd_config
file.LD_PRELOAD
techniques, because all TCP sockets created by the service will be modified without sshd's knowledge.LD_PRELOAD
being set. That's maybe OK for occasional commands, less for regular ones, or for GUI applications.ProxyCommand
option 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.Hopefully this new option can help users to enable MPTCP support on both the client and server side.