28 lines
375 B
Go
28 lines
375 B
Go
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)
|
|
}
|