summaryrefslogtreecommitdiffhomepage
path: root/send.go
diff options
context:
space:
mode:
Diffstat (limited to 'send.go')
-rw-r--r--send.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/send.go b/send.go
index 5c12589..311facc 100644
--- a/send.go
+++ b/send.go
@@ -264,8 +264,10 @@ func (device *Device) RoutineReadFromTUN() {
size, err := device.tun.device.Read(elem.buffer[:], offset)
if err != nil {
- logError.Println("Failed to read packet from TUN device:", err)
- device.Close()
+ if !device.isClosed.Get() {
+ logError.Println("Failed to read packet from TUN device:", err)
+ device.Close()
+ }
return
}