net/portmapper: don't treat 0.0.0.0 as a valid IP

Updates tailscale/corp#23538

Change-Id: I58b8c30abe43f1d1829f01eb9fb2c1e6e8db9476
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/13524/merge
Brad Fitzpatrick 2 months ago committed by Brad Fitzpatrick
parent 16ef88754d
commit 262c526c4e

@ -781,6 +781,10 @@ func parsePMPResponse(pkt []byte) (res pmpResponse, ok bool) {
return res, false return res, false
} }
res.PublicAddr = netaddr.IPv4(pkt[8], pkt[9], pkt[10], pkt[11]) res.PublicAddr = netaddr.IPv4(pkt[8], pkt[9], pkt[10], pkt[11])
if res.PublicAddr.IsUnspecified() {
// Zero it out so it's not Valid and used accidentally elsewhere.
res.PublicAddr = netip.Addr{}
}
} }
return res, true return res, true

Loading…
Cancel
Save