]> Cypherpunks.ru repositories - gostls13.git/commit
net: mptcp: implement dialMPTCP
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Fri, 24 Feb 2023 16:51:57 +0000 (17:51 +0100)
committerGopher Robot <gobot@golang.org>
Wed, 29 Mar 2023 22:12:18 +0000 (22:12 +0000)
commit0bd94e4387da2ce056c0f4e9bfa66976841710a5
treefcff44f6180e586f7c039cc020e98954d1a802c3
parent6615324f79bf16e1c81951c9a18e51d1908f2698
net: mptcp: implement dialMPTCP

This function is called when the user has requested MPTCP via
SetMultipathTCP in the Dialer.

This new function falls back to dialTCP on operating systems that do not
support MPTCP or if MPTCP is not supported.

On Dialer side, MultipathTCP function can be used to know if the package
will try to use MPTCP or not when Dial is called.

Note that this new dialMPTCP function returns a TCPConn object, like
dialTCP. A new MPTCPConn object using the following composition could
have been returned:

    type MPTCPConn struct {
        *TCPConn
    }

But the drawback is that if MPTCP is used by default one day (see #56539
issue on GitHub), Dial will return a different object: this new
MPTCPConn type instead of the previously expected TCPConn. This can
cause issues for apps checking the returned object.

This work has been co-developped by Gregory Detal
<gregory.detal@tessares.net>.

Updates #56539

Change-Id: I0f9b5b81f630b39142bdd553d4f1b4c775f1dff0
Reviewed-on: https://go-review.googlesource.com/c/go/+/471136
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
api/next/56539.txt [new file with mode: 0644]
src/net/dial.go
src/net/mptcpsock_linux.go
src/net/mptcpsock_stub.go
src/net/tcpsock_posix.go