From d37451bac6f38cc09b853b08b1dc8359ba767fa1 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 29 Jul 2021 14:29:05 -0700 Subject: [PATCH] cmd/derper: dial VPC address with right context Fix bug from just-submitted e422e9f4c949. Updates #2414 Signed-off-by: Brad Fitzpatrick --- cmd/derper/mesh.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/derper/mesh.go b/cmd/derper/mesh.go index aadde1263..9c9a936f5 100644 --- a/cmd/derper/mesh.go +++ b/cmd/derper/mesh.go @@ -58,7 +58,7 @@ func startMeshWithHost(s *derp.Server, host string) error { ips, _ := r.LookupIP(subCtx, "ip", vpcHost) if len(ips) > 0 { vpcAddr := net.JoinHostPort(ips[0].String(), port) - c, err := d.DialContext(ctx, network, vpcAddr) + c, err := d.DialContext(subCtx, network, vpcAddr) if err == nil { log.Printf("connected to %v (%v) instead of %v", vpcHost, ips[0], base) return c, nil