diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-02-09 20:18:21 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-02-09 20:19:14 +0100 |
commit | 6f08a100410fb61093df5321b685b07ff8b801e6 (patch) | |
tree | c82b4384d5135c1d3c84f39d979bc2b6066a8d96 /device/sticky_linux.go | |
parent | a97ef39cd4a8a7612ff744ff0e7a4efdf3837214 (diff) |
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 'device/sticky_linux.go')
-rw-r--r-- | device/sticky_linux.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/device/sticky_linux.go b/device/sticky_linux.go index 594cd01..a984f24 100644 --- a/device/sticky_linux.go +++ b/device/sticky_linux.go @@ -49,6 +49,7 @@ func (device *Device) routineRouteListener(bind conn.Bind, netlinkSock int, netl var reqPeer map[uint32]peerEndpointPtr var reqPeerLock sync.Mutex + defer netlinkCancel.Close() defer unix.Close(netlinkSock) for msg := make([]byte, 1<<16); ; { |