all: disable TCP keep-alives on iOS/Android

Updates #2442
Updates tailscale/corp#2750

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-09-28 07:55:22 -07:00
committed by Brad Fitzpatrick
parent a7cb241db1
commit 173bbaa1a1
6 changed files with 40 additions and 3 deletions

View File

@ -19,6 +19,7 @@ import (
"net"
"inet.af/netaddr"
"tailscale.com/net/netknob"
"tailscale.com/syncs"
)
@ -45,7 +46,9 @@ func Listener() *net.ListenConfig {
// namespace that doesn't route back into Tailscale. It also handles
// using a SOCKS if configured in the environment with ALL_PROXY.
func NewDialer() Dialer {
return FromDialer(new(net.Dialer))
return FromDialer(&net.Dialer{
KeepAlive: netknob.PlatformTCPKeepAlive(),
})
}
// FromDialer returns sets d.Control as necessary to run in a logical