derp/derphttp: don't return all nil from dialRegion when STUNOnly nodes

This commit is contained in:
Brad Fitzpatrick 2020-07-27 10:10:10 -07:00
parent 990e2f1ae9
commit 69f3ceeb7c

View File

@ -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)