@@ -19,25 +19,25 @@ func SetNetstackOpts(s *stack.Stack) {
19
19
// TODO: other stack otps?
20
20
// github.com/xjasonlyu/tun2socks/blob/31468620e/core/option/option.go#L69
21
21
22
- // TODO: setup protocol opts?
23
- // github.com/google/gvisor/blob/ef9e8d91/test/benchmarks/tcp/tcp_proxy.go#L233
24
- sack := tcpip .TCPSACKEnabled (true )
25
- _ = s .SetTransportProtocolOption (tcp .ProtocolNumber , & sack )
22
+ if settings .GetDialerOpts ().LowerKeepAlive {
23
+ // TODO: setup protocol opts?
24
+ // github.com/google/gvisor/blob/ef9e8d91/test/benchmarks/tcp/tcp_proxy.go#L233
25
+ sack := tcpip .TCPSACKEnabled (true )
26
+ _ = s .SetTransportProtocolOption (tcp .ProtocolNumber , & sack )
26
27
27
- // from: github.com/telepresenceio/telepresence/blob/ab7dda7d55/pkg/vif/stack.go#L232
28
- // Enable Receive Buffer Auto-Tuning, see: github.com/google/gvisor/issues/1666
29
- bufauto := tcpip .TCPModerateReceiveBufferOption (true )
30
- _ = s .SetTransportProtocolOption (tcp .ProtocolNumber , & bufauto )
28
+ // from: github.com/telepresenceio/telepresence/blob/ab7dda7d55/pkg/vif/stack.go#L232
29
+ // Enable Receive Buffer Auto-Tuning, see: github.com/google/gvisor/issues/1666
30
+ bufauto := tcpip .TCPModerateReceiveBufferOption (true )
31
+ _ = s .SetTransportProtocolOption (tcp .ProtocolNumber , & bufauto )
31
32
32
- // coder.com/blog/delivering-5x-faster-throughput-in-coder-2-12-0
33
- ccopt := tcpip .CongestionControlOption ("cubic" )
34
- _ = s .SetTransportProtocolOption (tcp .ProtocolNumber , & ccopt )
33
+ // coder.com/blog/delivering-5x-faster-throughput-in-coder-2-12-0
34
+ ccopt := tcpip .CongestionControlOption ("cubic" )
35
+ _ = s .SetTransportProtocolOption (tcp .ProtocolNumber , & ccopt )
35
36
36
- ttl := tcpip .DefaultTTLOption (128 )
37
- s .SetNetworkProtocolOption (ipv4 .ProtocolNumber , & ttl )
38
- s .SetNetworkProtocolOption (ipv6 .ProtocolNumber , & ttl )
37
+ ttl := tcpip .DefaultTTLOption (128 )
38
+ s .SetNetworkProtocolOption (ipv4 .ProtocolNumber , & ttl )
39
+ s .SetNetworkProtocolOption (ipv6 .ProtocolNumber , & ttl )
39
40
40
- if settings .ExperimentalWireGuard .Load () {
41
41
// github.com/tailscale/tailscale/blob/c4d0237e5c/wgengine/netstack/netstack_tcpbuf_default.go
42
42
tcpRXBufOpt := tcpip.TCPReceiveBufferSizeRangeOption {
43
43
Min : tcp .MinBufferSize ,
0 commit comments