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

clone
Brad Fitzpatrick 4 years ago
parent 990e2f1ae9
commit 69f3ceeb7c

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

Loading…
Cancel
Save