mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	Add ability to select interface by friendly name on Windows
This commit is contained in:
		
							parent
							
								
									fcf7fe71af
								
							
						
					
					
						commit
						e381808704
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -23,6 +23,11 @@ func (tun *tunDevice) setup(ifname string, iftapmode bool, addr string, mtu int)
 | 
				
			||||||
	config := water.Config{DeviceType: water.TAP}
 | 
						config := water.Config{DeviceType: water.TAP}
 | 
				
			||||||
	config.PlatformSpecificParams.ComponentID = "tap0901"
 | 
						config.PlatformSpecificParams.ComponentID = "tap0901"
 | 
				
			||||||
	config.PlatformSpecificParams.Network = "169.254.0.1/32"
 | 
						config.PlatformSpecificParams.Network = "169.254.0.1/32"
 | 
				
			||||||
 | 
						if ifname == "auto" {
 | 
				
			||||||
 | 
							config.PlatformSpecificParams.InterfaceName = ""
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							config.PlatformSpecificParams.InterfaceName = ifname
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	iface, err := water.New(config)
 | 
						iface, err := water.New(config)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		panic(err)
 | 
							panic(err)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue