Cleanup - audit
This commit is contained in:
@@ -9,17 +9,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (a *App) onMulticastDiscovery(pkt multicast.Packet) {
|
func (a *App) onMulticastDiscovery(pkt multicast.Packet) {
|
||||||
if a.isPublic {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Locate the sender peer by its VPN IP (final octet carried in the beacon).
|
// Locate the sender peer by its VPN IP (final octet carried in the beacon).
|
||||||
octets := a.vpnNet.Addr().As4()
|
octets := a.vpnNet.Addr().As4()
|
||||||
octets[3] = pkt.PeerIP
|
octets[3] = pkt.PeerIP
|
||||||
vpnIP := netip.AddrFrom4(octets)
|
vpnIP := netip.AddrFrom4(octets)
|
||||||
|
|
||||||
peer, ok := a.peersByIP[vpnIP]
|
peer, ok := a.peersByIP[vpnIP]
|
||||||
if !ok || peer.IsPublic || peer.State == StateDirect {
|
if !ok {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user