mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 04:50:29 +00:00
skip multicast packets sent from our own key
This commit is contained in:
parent
1083131533
commit
cb81be94ec
@ -1,6 +1,7 @@
|
||||
package multicast
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/ed25519"
|
||||
"encoding/hex"
|
||||
@ -350,6 +351,9 @@ func (m *Multicast) listen() {
|
||||
}
|
||||
var key ed25519.PublicKey
|
||||
key = append(key, bs[:ed25519.PublicKeySize]...)
|
||||
if bytes.Equal(key, m.core.GetSelf().Key) {
|
||||
continue // don't bother trying to peer with self
|
||||
}
|
||||
anAddr := string(bs[ed25519.PublicKeySize:nBytes])
|
||||
addr, err := net.ResolveTCPAddr("tcp6", anAddr)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user