mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-12 05:37:32 +00:00
wgengine/magicsock, types/nettype, etc: finish ReadFromUDPAddrPort netip migration
So we're staying within the netip.Addr/AddrPort consistently and avoiding allocs/conversions to the legacy net addr types. Updates #5162 Change-Id: I59feba60d3de39f773e68292d759766bac98c917 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
29f7df9d8f
commit
10f1c90f4d
@@ -30,11 +30,11 @@ func (Std) ListenPacket(ctx context.Context, network, address string) (net.Packe
|
||||
return conf.ListenPacket(ctx, network, address)
|
||||
}
|
||||
|
||||
// PacketConn is a net.PacketConn that's about halfway (as of 2023-04-15)
|
||||
// converted to use netip.AddrPort.
|
||||
// PacketConn is like a net.PacketConn but uses the newer netip.AddrPort
|
||||
// write/read methods.
|
||||
type PacketConn interface {
|
||||
WriteToUDPAddrPort([]byte, netip.AddrPort) (int, error)
|
||||
ReadFrom(p []byte) (int, net.Addr, error)
|
||||
ReadFromUDPAddrPort([]byte) (int, netip.AddrPort, error)
|
||||
io.Closer
|
||||
LocalAddr() net.Addr
|
||||
SetDeadline(time.Time) error
|
||||
|
Reference in New Issue
Block a user