mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	tun: OpenBSD: IPv6 ioctls require an IPv6 socket
Otherwise you get "panic: inappropriate ioctl for device", even for a perfectly fine ioctl(2) call.
This commit is contained in:
		
							parent
							
								
									32b4c58f74
								
							
						
					
					
						commit
						d68eeb1465
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -67,8 +67,8 @@ func (tun *TunAdapter) setupAddress(addr string) error {
 | 
			
		|||
	var err error
 | 
			
		||||
 | 
			
		||||
	// Create system socket
 | 
			
		||||
	if sfd, err = unix.Socket(unix.AF_INET, unix.SOCK_DGRAM, 0); err != nil {
 | 
			
		||||
		tun.log.Printf("Create AF_INET socket failed: %v.", err)
 | 
			
		||||
	if sfd, err = unix.Socket(unix.AF_INET6, unix.SOCK_DGRAM, 0); err != nil {
 | 
			
		||||
		tun.log.Printf("Create AF_INET6 socket failed: %v", err)
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue