|
|
@@ -19,6 +19,7 @@ import (
|
|
|
"net/netip"
|
|
|
"runtime"
|
|
|
"sort"
|
|
|
+ "strings"
|
|
|
"sync"
|
|
|
"time"
|
|
|
|
|
|
@@ -1112,6 +1113,14 @@ func (c *Client) checkCaptivePortal(ctx context.Context, dm *tailcfg.DERPMap, pr
|
|
|
}
|
|
|
|
|
|
node := dm.Regions[preferredDERP].Nodes[0]
|
|
|
+
|
|
|
+ if strings.HasSuffix(node.HostName, tailcfg.DotInvalid) {
|
|
|
+ // Don't try to connect to invalid hostnames. This occurred in tests:
|
|
|
+ // https://github.com/tailscale/tailscale/issues/6207
|
|
|
+ // TODO(bradfitz,andrew-d): how to actually handle this nicely?
|
|
|
+ return false, nil
|
|
|
+ }
|
|
|
+
|
|
|
req, err := http.NewRequestWithContext(ctx, "GET", "http://"+node.HostName+"/generate_204", nil)
|
|
|
if err != nil {
|
|
|
return false, err
|