mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	save only the link-local addresses for multicast
This commit is contained in:
		
							parent
							
								
									de79401bb2
								
							
						
					
					
						commit
						95f4ec52a4
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -292,15 +292,15 @@ func (m *Multicast) _updateInterfaces() {
 | 
			
		|||
			aInfo.addrs, _ = iface.Addrs()
 | 
			
		||||
			aInfo.time = time.Now()
 | 
			
		||||
		}
 | 
			
		||||
		hasLLAddr := false
 | 
			
		||||
		lladdrs := aInfo.addrs[:0]
 | 
			
		||||
		for _, addr := range aInfo.addrs {
 | 
			
		||||
			addrIP, _, _ := net.ParseCIDR(addr.String())
 | 
			
		||||
			if addrIP.To4() == nil && addrIP.IsLinkLocalUnicast() {
 | 
			
		||||
				hasLLAddr = true
 | 
			
		||||
				break
 | 
			
		||||
				lladdrs = append(lladdrs, addr)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		if !hasLLAddr {
 | 
			
		||||
		aInfo.addrs = lladdrs
 | 
			
		||||
		if len(lladdrs) == 0 {
 | 
			
		||||
			// Ignore interfaces without link-local addresses
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue