From 0be475ba466fc5b6391656a3be1c9416db859753 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 20 Mar 2020 03:19:59 -0700 Subject: [PATCH] Revert "tailcfg, controlclient, magicsock: request IPv6 endpoints, but ignore them" Breaks something deep in wireguard or magicsock's brainstem, no packets at all can flow. All received packets fail decryption with "invalid mac1". This reverts commit 94024355edd563473345e28f9d441e46fd14c70f. Signed-off-by: David Anderson --- control/controlclient/direct.go | 13 ++++++------- tailcfg/tailcfg.go | 15 +++++++-------- wgengine/magicsock/magicsock.go | 4 ---- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index b17ac0d9e..b89b31581 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -448,13 +448,12 @@ func (c *Direct) PollNetMap(ctx context.Context, maxPolls int, cb func(*NetworkM c.logf("PollNetMap: stream=%v :%v %v\n", maxPolls, localPort, ep) request := tailcfg.MapRequest{ - Version: 4, - IncludeIPv6: true, - KeepAlive: c.keepAlive, - NodeKey: tailcfg.NodeKey(persist.PrivateNodeKey.Public()), - Endpoints: ep, - Stream: allowStream, - Hostinfo: hostinfo, + Version: 4, + 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/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index f914c1d23..715ec2df1 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -391,14 +391,13 @@ type RegisterResponse struct { // using the local machine key, and sent to: // https://login.tailscale.com/machine//map type MapRequest struct { - Version int // current version is 4 - Compress string // "zstd" or "" (no compression) - KeepAlive bool // server sends keep-alives - NodeKey NodeKey - Endpoints []string // caller's endpoints (IPv4 or IPv6) - IncludeIPv6 bool // include IPv6 endpoints in returned Node Endpoints - Stream bool // if true, multiple MapResponse objects are returned - Hostinfo *Hostinfo + Version int // current version is 4 + Compress string // "zstd" or "" (no compression) + KeepAlive bool // server sends keep-alives + NodeKey NodeKey + Endpoints []string + Stream bool // if true, multiple MapResponse objects are returned + Hostinfo *Hostinfo } type MapResponse struct { diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index 86fb03b4a..7d0de925b 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -1456,10 +1456,6 @@ 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) }