From 69f3ceeb7ccacdc1dfb6293869093b8d6d9669e2 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 27 Jul 2020 10:10:10 -0700 Subject: [PATCH] derp/derphttp: don't return all nil from dialRegion when STUNOnly nodes --- derp/derphttp/derphttp_client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/derp/derphttp/derphttp_client.go b/derp/derphttp/derphttp_client.go index 946c8c937..83697c257 100644 --- a/derp/derphttp/derphttp_client.go +++ b/derp/derphttp/derphttp_client.go @@ -338,6 +338,9 @@ func (c *Client) dialRegion(ctx context.Context, reg *tailcfg.DERPRegion) (net.C var firstErr error for _, n := range reg.Nodes { if n.STUNOnly { + if firstErr == nil { + firstErr = fmt.Errorf("no non-STUNOnly nodes for %s", c.targetString(reg)) + } continue } c, err := c.dialNode(ctx, n)