disco: fix UDPRelayEndpoint.AddrPorts slice cap math
Fixes tailscale/corp#45066 Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
committed by
Jordan Whited
parent
7ec9b7ffa3
commit
94381a191a
+1
-1
@@ -605,7 +605,7 @@ func (m *UDPRelayEndpoint) decode(b []byte) error {
|
||||
b = b[8:]
|
||||
m.SteadyStateLifetime = time.Duration(binary.BigEndian.Uint64(b[:8]))
|
||||
b = b[8:]
|
||||
m.AddrPorts = make([]netip.AddrPort, 0, len(b)-udpRelayEndpointLenMinusAddrPorts/epLength)
|
||||
m.AddrPorts = make([]netip.AddrPort, 0, len(b)/epLength)
|
||||
for len(b) > 0 {
|
||||
var a [16]byte
|
||||
copy(a[:], b)
|
||||
|
||||
Reference in New Issue
Block a user