From 6f08a100410fb61093df5321b685b07ff8b801e6 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 9 Feb 2021 20:18:21 +0100 Subject: 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 --- tun/tun_linux.go | 1 + 1 file changed, 1 insertion(+) (limited to 'tun/tun_linux.go') 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); ; { -- cgit v1.2.3