mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	fix error spam on shutdown
This commit is contained in:
		
							parent
							
								
									bd92c117e1
								
							
						
					
					
						commit
						6560aac1e9
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -57,9 +57,9 @@ func (r *tunReader) _read() {
 | 
			
		|||
	n, err := r.tun.iface.Read(recvd, TUN_OFFSET_BYTES)
 | 
			
		||||
	if n <= TUN_OFFSET_BYTES || err != nil {
 | 
			
		||||
		r.tun.log.Errorln("Error reading TUN:", err)
 | 
			
		||||
		err = r.tun.iface.Flush()
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			r.tun.log.Errorln("Unable to flush packets:", err)
 | 
			
		||||
		ferr := r.tun.iface.Flush()
 | 
			
		||||
		if ferr != nil {
 | 
			
		||||
			r.tun.log.Errorln("Unable to flush packets:", ferr)
 | 
			
		||||
		}
 | 
			
		||||
		util.PutBytes(recvd)
 | 
			
		||||
	} else {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue