mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	skip multicast packets sent from our own key
This commit is contained in:
		
							parent
							
								
									1083131533
								
							
						
					
					
						commit
						cb81be94ec
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue