Cleanup - audit

This commit is contained in:
jdl
2026-06-13 20:01:08 +02:00
parent 111f3f4d20
commit c356347cf6

View File

@@ -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
} }