diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index 8e2df94cf..f07c5c803 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -18,6 +18,7 @@ "net/http" "os" "runtime" + "strconv" "strings" "sync" "time" @@ -447,13 +448,18 @@ func (c *Direct) PollNetMap(ctx context.Context, maxPolls int, cb func(*NetworkM allowStream := maxPolls != 1 c.logf("PollNetMap: stream=%v :%v %v\n", maxPolls, localPort, ep) + // TODO(bradfitz): once this is verified to not be problematic, remove this + // knob and hard-code true below. + includeIPv6, _ := strconv.ParseBool(os.Getenv("DEBUG_INCLUDE_IPV6")) + request := tailcfg.MapRequest{ - Version: 4, - KeepAlive: c.keepAlive, - NodeKey: tailcfg.NodeKey(persist.PrivateNodeKey.Public()), - Endpoints: ep, - Stream: allowStream, - Hostinfo: hostinfo, + Version: 4, + IncludeIPv6: includeIPv6, + KeepAlive: c.keepAlive, + NodeKey: tailcfg.NodeKey(persist.PrivateNodeKey.Public()), + Endpoints: ep, + Stream: allowStream, + Hostinfo: hostinfo, } if c.newDecompressor != nil { request.Compress = "zstd" diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index 1d4f13f44..346091467 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -1456,6 +1456,10 @@ func (c *Conn) CreateEndpoint(key [32]byte, addrs string) (conn.Endpoint, error) } if ip4 := addr.IP.To4(); ip4 != nil { addr.IP = ip4 + } else { + // TODO(bradfitz): stop skipping IPv6 ones for now. + c.logf("magicsock: CreateEndpoint: ignoring IPv6 addr %v for now", addr) + continue } a.addrs = append(a.addrs, *addr) }