mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-10 09:45:08 +00:00
Update netaddr, and adjust wgengine/magicsock due to API change.
Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
@@ -988,12 +988,16 @@ var errConnClosed = errors.New("Conn closed")
|
||||
|
||||
var errDropDerpPacket = errors.New("too many DERP packets queued; dropping")
|
||||
|
||||
var udpAddrPool = &sync.Pool{
|
||||
New: func() interface{} { return new(net.UDPAddr) },
|
||||
}
|
||||
|
||||
// sendUDP sends UDP packet b to ipp.
|
||||
// See sendAddr's docs on the return value meanings.
|
||||
func (c *Conn) sendUDP(ipp netaddr.IPPort, b []byte) (sent bool, err error) {
|
||||
ua := ipp.UDPAddr()
|
||||
defer netaddr.PutUDPAddr(ua)
|
||||
return c.sendUDPStd(ua, b)
|
||||
ua := udpAddrPool.Get().(*net.UDPAddr)
|
||||
defer udpAddrPool.Put(ua)
|
||||
return c.sendUDPStd(ipp.UDPAddrAt(ua), b)
|
||||
}
|
||||
|
||||
// sendUDP sends UDP packet b to addr.
|
||||
|
Reference in New Issue
Block a user