Skip to content

Commit 0f2a345

Browse files
committed
netstack/tcp: enable keepalive to rid of lingering sockets
1 parent fa2f8c1 commit 0f2a345

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

intra/netstack/tcp.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,14 @@ func (g *GTCPConn) synack(complete bool) (rst bool, err error) {
170170

171171
func keepalive(ep tcpip.Endpoint) {
172172
if settings.GetDialerOpts().LowerKeepAlive {
173-
sockopt(ep, &defaultKeepAliveIdle, &defaultKeepAliveInterval, &defaultUserTimeout)
173+
// github.com/tailscale/tailscale/issues/4522 (low keepalive)
174+
// github.com/tailscale/tailscale/pull/6147 (high keepalive)
175+
// github.com/tailscale/tailscale/issues/6148 (other changes)
176+
sockopt(ep, &defaultKeepAliveIdle, &defaultKeepAliveInterval, &usrTimeout)
174177
ep.SetSockOptInt(tcpip.KeepaliveCountOption, defaultKeepAliveCount)
175-
ep.SocketOptions().SetKeepAlive(true)
176178
}
179+
// github.com/tailscale/tailscale/commit/1aa75b1c9ea2
180+
ep.SocketOptions().SetKeepAlive(true) // applies netstack defaults
177181
}
178182

179183
func sockopt(ep tcpip.Endpoint, opts ...tcpip.SettableSocketOption) {

0 commit comments

Comments
 (0)