diff options
Diffstat (limited to 'device/send.go')
-rw-r--r-- | device/send.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/device/send.go b/device/send.go index e07df1b..a4f07e4 100644 --- a/device/send.go +++ b/device/send.go @@ -8,7 +8,9 @@ package device import ( "bytes" "encoding/binary" + "errors" "net" + "os" "sync" "sync/atomic" "time" @@ -227,7 +229,9 @@ func (device *Device) RoutineReadFromTUN() { if err != nil { if !device.isClosed() { - device.log.Errorf("Failed to read packet from TUN device: %v", err) + if !errors.Is(err, os.ErrClosed) { + device.log.Errorf("Failed to read packet from TUN device: %v", err) + } go device.Close() } device.PutMessageBuffer(elem.buffer) |