mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 14:57:49 +00:00
logpolicy: use netns for dialing log.tailscale.io.
This commit is contained in:
parent
e9f7d01b91
commit
a6bd3a7e53
@ -29,6 +29,7 @@
|
||||
"tailscale.com/atomicfile"
|
||||
"tailscale.com/logtail"
|
||||
"tailscale.com/logtail/filch"
|
||||
"tailscale.com/net/netns"
|
||||
"tailscale.com/net/tlsdial"
|
||||
"tailscale.com/version"
|
||||
)
|
||||
@ -249,11 +250,10 @@ func newLogtailTransport(host string) *http.Transport {
|
||||
|
||||
// Log whenever we dial:
|
||||
tr.DialContext = func(ctx context.Context, netw, addr string) (net.Conn, error) {
|
||||
nd := &net.Dialer{
|
||||
Timeout: 30 * time.Second,
|
||||
KeepAlive: 30 * time.Second,
|
||||
DualStack: true,
|
||||
}
|
||||
nd := netns.Dialer()
|
||||
nd.Timeout = 30 * time.Second
|
||||
nd.KeepAlive = 30 * time.Second
|
||||
nd.DualStack = true
|
||||
t0 := time.Now()
|
||||
c, err := nd.DialContext(ctx, netw, addr)
|
||||
d := time.Since(t0).Round(time.Millisecond)
|
||||
|
Loading…
x
Reference in New Issue
Block a user