controlclient, magicsock: add debug knob to request IPv6 endpoints

Add opt-in method to request IPv6 endpoints from the control plane.
For now they should just be skipped. A previous version of this CL was
unconditional and reportedly had problems that I can't reproduce. So
make it a knob until the mystery is solved.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-03-19 20:45:49 -07:00
parent 221e7d7767
commit af277a6762
2 changed files with 16 additions and 6 deletions

View File

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