golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.21k stars 17.7k forks source link

net: MPTCP support is not enabled when apps use `ListenTCP()` or `DialTCP()` #70500

Closed matttbe closed 6 hours ago

matttbe commented 11 hours ago

Go version

go version devel go1.24-02df9bbdbd Thu Nov 21 15:52:29 2024 +0000 linux/amd64

Output of go env in your module/workspace:

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/devel/.cache/go-build'
GODEBUG=''
GOENV='/home/devel/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3720308608=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/devel/Workspace/go/src/go.mod'
GOMODCACHE='/home/devel/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/devel/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/devel/Workspace/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/devel/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/devel/Workspace/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='devel go1.24-02df9bbdbd Thu Nov 21 15:52:29 2024 +0000'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

Having GODEBUG=multipathtcp=1 being set when running Go apps using ListenTCP() or DialTCP() directly.

Or checking if MPTCP is used on a system supporting it, with Go 1.24 and a Go app using ListenTCP() directly.

What did you see happen?

MPTCP is unexpectedly not used when GODEBUG=multipathtcp=1 is set for these apps.

Same when using Go 1.24 with an app using ListenTCP() directly: MPTCP is unexpectedly not used.

What did you expect to see?

Setting GODEBUG=multipathtcp= has no effects on apps using ListenTCP() or DialTCP() directly.

According to the documentation, these functions are supposed to act like Listen and Dial respectively:

ListenTCP acts like Listen for TCP networks. DialTCP acts like Dial for TCP networks.

So when reading this, I think we should expect GODEBUG=multipathtcp= to act on these functions as well.

Also, since #69016, MPTCP is used by default (if supported) with TCP listeners. Similarly, when ListenTCP() is used directly, MPTCP is unexpectedly not used. It is strange to have a different behaviour.

gabyhelp commented 11 hours ago

Related Issues

Related Code Changes

Related Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

gopherbot commented 10 hours ago

Change https://go.dev/cl/630715 mentions this issue: net: check for MPTCP in DialTCP and ListenTCP