cmd/derper: dial VPC address with right context

Fix bug from just-submitted e422e9f4c9.

Updates #2414

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
crawshaw/peerdoh
Brad Fitzpatrick 3 years ago
parent e422e9f4c9
commit d37451bac6

@ -58,7 +58,7 @@ func startMeshWithHost(s *derp.Server, host string) error {
ips, _ := r.LookupIP(subCtx, "ip", vpcHost) ips, _ := r.LookupIP(subCtx, "ip", vpcHost)
if len(ips) > 0 { if len(ips) > 0 {
vpcAddr := net.JoinHostPort(ips[0].String(), port) vpcAddr := net.JoinHostPort(ips[0].String(), port)
c, err := d.DialContext(ctx, network, vpcAddr) c, err := d.DialContext(subCtx, network, vpcAddr)
if err == nil { if err == nil {
log.Printf("connected to %v (%v) instead of %v", vpcHost, ips[0], base) log.Printf("connected to %v (%v) instead of %v", vpcHost, ips[0], base)
return c, nil return c, nil

Loading…
Cancel
Save