aboutsummaryrefslogtreecommitdiffstats
path: root/tun
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-02-09 20:18:21 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-02-09 20:19:14 +0100
commit6f08a100410fb61093df5321b685b07ff8b801e6 (patch)
treec82b4384d5135c1d3c84f39d979bc2b6066a8d96 /tun
parentrwcancel: use errors.Is for unwrapping (diff)
downloadwireguard-go-6f08a100410fb61093df5321b685b07ff8b801e6.tar.xz
wireguard-go-6f08a100410fb61093df5321b685b07ff8b801e6.zip
rwcancel: add an explicit close call
This lets us collect FDs even if the GC doesn't do it for us. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tun')
-rw-r--r--tun/tun_linux.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/tun/tun_linux.go b/tun/tun_linux.go
index be36c69..501f3a3 100644
--- a/tun/tun_linux.go
+++ b/tun/tun_linux.go
@@ -106,6 +106,7 @@ func (tun *NativeTun) routineNetlinkListener() {
unix.Close(tun.netlinkSock)
tun.hackListenerClosed.Lock()
close(tun.events)
+ tun.netlinkCancel.Close()
}()
for msg := make([]byte, 1<<16); ; {