net/tstun: accept peerapi connections through the filter

Fixes tailscale/corp#1545

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-04-07 11:32:53 -07:00
committed by Brad Fitzpatrick
parent 950fc28887
commit 939861773d
3 changed files with 115 additions and 3 deletions

View File

@@ -1366,7 +1366,7 @@ func (b *LocalBackend) getPeerAPIPortForTSMPPing(ip netaddr.IP) (port uint16, ok
b.mu.Lock()
defer b.mu.Unlock()
for _, pln := range b.peerAPIListeners {
if pln.ip.BitLen() == ip.BitLen() {
if pln.ip == ip {
return uint16(pln.port), true
}
}