From 6560aac1e9eb3b3d3c1f0ef29ae8ecdf8a34a767 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sun, 24 Nov 2019 13:42:56 -0600 Subject: [PATCH] fix error spam on shutdown --- src/tuntap/iface.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tuntap/iface.go b/src/tuntap/iface.go index fbb7c86..f80ea4f 100644 --- a/src/tuntap/iface.go +++ b/src/tuntap/iface.go @@ -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 {