mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-24 09:39:39 +00:00
wgengine/magicsock, etc: remove mostly unused WriteTo methods
Updates #2331 Updates #5162 Change-Id: I8291884425481eeaedde38a54adfd8ed7292a497 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
83c41f3697
commit
29f7df9d8f
@@ -517,9 +517,14 @@ func nodeMight4(n *tailcfg.DERPNode) bool {
|
||||
return ip.Is4()
|
||||
}
|
||||
|
||||
type packetReaderFromCloser interface {
|
||||
ReadFrom([]byte) (int, net.Addr, error)
|
||||
io.Closer
|
||||
}
|
||||
|
||||
// readPackets reads STUN packets from pc until there's an error or ctx is done.
|
||||
// In either case, it closes pc.
|
||||
func (c *Client) readPackets(ctx context.Context, pc net.PacketConn) {
|
||||
func (c *Client) readPackets(ctx context.Context, pc packetReaderFromCloser) {
|
||||
done := make(chan struct{})
|
||||
defer close(done)
|
||||
|
||||
@@ -902,7 +907,9 @@ func (c *Client) GetReport(ctx context.Context, dm *tailcfg.DERPMap) (_ *Report,
|
||||
// So do that for now. In the future we might want to classify networks
|
||||
// that do and don't require this separately. But for now help it.
|
||||
const documentationIP = "203.0.113.1"
|
||||
rs.pc4Hair.WriteTo([]byte("tailscale netcheck; see https://github.com/tailscale/tailscale/issues/188"), &net.UDPAddr{IP: net.ParseIP(documentationIP), Port: 12345})
|
||||
rs.pc4Hair.WriteToUDPAddrPort(
|
||||
[]byte("tailscale netcheck; see https://github.com/tailscale/tailscale/issues/188"),
|
||||
netip.AddrPortFrom(netip.MustParseAddr(documentationIP), 12345))
|
||||
|
||||
if f := c.GetSTUNConn4; f != nil {
|
||||
rs.pc4 = f()
|
||||
|
||||
Reference in New Issue
Block a user