derp/derphttp: make DERP client use netns for dial-outs.

This commit is contained in:
David Anderson
2020-05-28 23:48:08 +00:00
parent 9e3ad4f79f
commit e9f7d01b91
2 changed files with 10 additions and 2 deletions

View File

@ -23,6 +23,13 @@ func Listener() *net.ListenConfig {
return &net.ListenConfig{Control: control}
}
// Dialer returns a new net.Dialer with its Control hook func
// initialized as necessary to run in a logical network namespace that
// doesn't route back into Tailscale.
func Dialer() *net.Dialer {
return &net.Dialer{Control: control}
}
// control marks c as necessary to dial in a separate network namespace.
//
// It's intentionally the same signature as net.Dialer.Control