From e1523fe6866bb375be2d245d267c9c2773b5b17d Mon Sep 17 00:00:00 2001 From: James Tucker Date: Thu, 6 Feb 2025 10:51:01 -0800 Subject: [PATCH] cmd/natc: remove speculative tuning from natc These tunings reduced memory usage while the implementation was struggling with earlier bugs, but will no longer be necessary after those bugs are addressed. Depends #14933 Depends #14934 Updates #9707 Updates #10408 Updates tailscale/corp#24483 Updates tailscale/corp#25169 Signed-off-by: James Tucker --- cmd/natc/natc.go | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/cmd/natc/natc.go b/cmd/natc/natc.go index 818947a13..956d2455e 100644 --- a/cmd/natc/natc.go +++ b/cmd/natc/natc.go @@ -27,8 +27,6 @@ import ( "github.com/inetaf/tcpproxy" "github.com/peterbourgon/ff/v3" "golang.org/x/net/dns/dnsmessage" - "gvisor.dev/gvisor/pkg/tcpip" - "gvisor.dev/gvisor/pkg/tcpip/transport/tcp" "tailscale.com/client/local" "tailscale.com/envknob" "tailscale.com/hostinfo" @@ -140,26 +138,6 @@ func main() { } // TODO(raggi): this is not a public interface or guarantee. ns := ts.Sys().Netstack.Get().(*netstack.Impl) - tcpRXBufOpt := tcpip.TCPReceiveBufferSizeRangeOption{ - Min: tcp.MinBufferSize, - Default: tcp.DefaultReceiveBufferSize, - Max: tcp.MaxBufferSize, - } - if err := ns.SetTransportProtocolOption(tcp.ProtocolNumber, &tcpRXBufOpt); err != nil { - log.Fatalf("could not set TCP RX buf size: %v", err) - } - tcpTXBufOpt := tcpip.TCPSendBufferSizeRangeOption{ - Min: tcp.MinBufferSize, - Default: tcp.DefaultSendBufferSize, - Max: tcp.MaxBufferSize, - } - if err := ns.SetTransportProtocolOption(tcp.ProtocolNumber, &tcpTXBufOpt); err != nil { - log.Fatalf("could not set TCP TX buf size: %v", err) - } - mslOpt := tcpip.TCPTimeWaitTimeoutOption(5 * time.Second) - if err := ns.SetTransportProtocolOption(tcp.ProtocolNumber, &mslOpt); err != nil { - log.Fatalf("could not set TCP MSL: %v", err) - } if *debugPort != 0 { expvar.Publish("netstack", ns.ExpVar()) }