From 323747c3e0c1c79bfad1bd28c76b351b076f942d Mon Sep 17 00:00:00 2001 From: Andrew Lytvynov Date: Wed, 19 Feb 2025 10:41:45 -0800 Subject: [PATCH] various: disable MPTCP when setting TCP_USER_TIMEOUT sockopt (#15063) There's nothing about it on https://github.com/multipath-tcp/mptcp_net-next/issues/ but empirically MPTCP doesn't support this option on awly's kernel 6.13.2 and in GitHub actions. Updates #15015 Signed-off-by: Andrew Lytvynov --- cmd/derper/derper.go | 3 +++ net/ktimeout/ktimeout_linux_test.go | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/derper/derper.go b/cmd/derper/derper.go index 4af63e192..980870847 100644 --- a/cmd/derper/derper.go +++ b/cmd/derper/derper.go @@ -324,6 +324,9 @@ func main() { Control: ktimeout.UserTimeout(*tcpUserTimeout), KeepAlive: *tcpKeepAlive, } + // As of 2025-02-19, MPTCP does not support TCP_USER_TIMEOUT socket option + // set in ktimeout.UserTimeout above. + lc.SetMultipathTCP(false) quietLogger := log.New(logger.HTTPServerLogFilter{Inner: log.Printf}, "", 0) httpsrv := &http.Server{ diff --git a/net/ktimeout/ktimeout_linux_test.go b/net/ktimeout/ktimeout_linux_test.go index a367bfd4a..df4156745 100644 --- a/net/ktimeout/ktimeout_linux_test.go +++ b/net/ktimeout/ktimeout_linux_test.go @@ -4,17 +4,22 @@ package ktimeout import ( + "context" "net" "testing" "time" - "golang.org/x/net/nettest" "golang.org/x/sys/unix" "tailscale.com/util/must" ) func TestSetUserTimeout(t *testing.T) { - l := must.Get(nettest.NewLocalListener("tcp")) + lc := net.ListenConfig{} + // As of 2025-02-19, MPTCP does not support TCP_USER_TIMEOUT socket option + // set in ktimeout.UserTimeout above. + lc.SetMultipathTCP(false) + + l := must.Get(lc.Listen(context.Background(), "tcp", "localhost:0")) defer l.Close() var err error