fix error spam on shutdown

This commit is contained in:
Arceliar 2019-11-24 13:42:56 -06:00
parent bd92c117e1
commit 6560aac1e9

View File

@ -57,9 +57,9 @@ func (r *tunReader) _read() {
n, err := r.tun.iface.Read(recvd, TUN_OFFSET_BYTES) n, err := r.tun.iface.Read(recvd, TUN_OFFSET_BYTES)
if n <= TUN_OFFSET_BYTES || err != nil { if n <= TUN_OFFSET_BYTES || err != nil {
r.tun.log.Errorln("Error reading TUN:", err) r.tun.log.Errorln("Error reading TUN:", err)
err = r.tun.iface.Flush() ferr := r.tun.iface.Flush()
if err != nil { if ferr != nil {
r.tun.log.Errorln("Unable to flush packets:", err) r.tun.log.Errorln("Unable to flush packets:", ferr)
} }
util.PutBytes(recvd) util.PutBytes(recvd)
} else { } else {