WIP
This commit is contained in:
27
peer/on_multicast.go
Normal file
27
peer/on_multicast.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user