disco: fix UDPRelayEndpoint.AddrPorts slice cap math

Fixes tailscale/corp#45066

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited
2026-07-17 09:11:12 -07:00
committed by Jordan Whited
parent 7ec9b7ffa3
commit 94381a191a
+1 -1
View File
@@ -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)