This commit is contained in:
jdl
2026-06-06 18:46:46 +02:00
parent b972784d90
commit 199f774ed3
16 changed files with 1168 additions and 0 deletions

27
peer/on_multicast.go Normal file
View File

@@ -0,0 +1,27 @@
package peer
import "net/netip"
func (a *App) onMulticastDiscovery(e MulticastEvent) {
if a.isPublic {
return
}
peer, ok := a.peersByKey[e.pubKey]
if !ok {
return
}
if peer.IsPublic || peer.State == StateDirect {
return
}
var v4, v6 netip.AddrPort
if e.endpoint.Addr().Is4() {
v4 = e.endpoint
} else {
v6 = e.endpoint
}
a.addProbe(peer, v4, v6)
}