Skip to contentSkip to conversation

Close the tun fd when closing the device

PATCH New Aurélien Chabot 2 participants 4 messages Nov 10, 2017

lore
Share & tools
lore
#0 lore raw

This patch was part of the android development, as this is not specific to android, here is an independent patch.

#1 lore raw

PATCH 1/1 Close the tun fd when closing the device

We also need to listen to the stop signal in the read tun function to avoid reading a close tun device.

---
 src/device.go |  1 +
 src/send.go   | 77 ++++++++++++++++++++++++++++++++---------------------------
 2 files changed, 43 insertions(+), 35 deletions(-)
src/device.go +1 -0
index 61c87bc..8567a36 100644
@@ -205,6 +205,7 @@ func (device *Device) Close() {
 	device.RemoveAllPeers()
 	close(device.signal.stop)
 	closeUDPConn(device)
+	device.tun.device.Close()
 }
 
 func (device *Device) WaitChannel() chan struct{} {
src/send.go +42 -35

95 lines not on this page · raw message

Signature · 1 line
2.15.0
#2 lore raw
In reply to Aurélien Chabot
Quoted 2 lines · Aurélien Chabot

This patch was part of the android development, as this is not specific to android, here is an independent patch.

You forgot to attach the patch.. :)

Cheers,
Georg

#3 lore raw
Quoted 5 lines · Georg Faerber
Quoted 2 lines · Aurélien Chabot

This patch was part of the android development, as this is not specific to android, here is an independent patch.

You forgot to attach the patch.. :)

Sorry for the noise! :x