mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	don't return an error if the source address is wrong, since this happens very frequently for link-local traffic
This commit is contained in:
		
							parent
							
								
									c6a7a077a3
								
							
						
					
					
						commit
						2726dc0076
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -289,7 +289,9 @@ func (k *keyStore) writePC(bs []byte) (int, error) {
 | 
			
		|||
	copy(srcSubnet[:], bs[8:])
 | 
			
		||||
	copy(dstSubnet[:], bs[24:])
 | 
			
		||||
	if srcAddr != k.address && srcSubnet != k.subnet {
 | 
			
		||||
		return 0, errors.New("wrong source address")
 | 
			
		||||
		// This happens all the time due to link-local traffic
 | 
			
		||||
		// Don't send back an error, just drop it
 | 
			
		||||
		return 0, nil
 | 
			
		||||
	}
 | 
			
		||||
	buf := make([]byte, 1+len(bs), 65535)
 | 
			
		||||
	buf[0] = typeSessionTraffic
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue