If the stack is not closed when closing netTun then goroutines will be leaked because the the transport protocols remain open. This adds the needed close call.
Signed-off-by: Nick Goossens <ngooss...@duckduckgo.com> --- tun/netstack/tun.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tun/netstack/tun.go b/tun/netstack/tun.go index 2b73054..a06bc21 100644 --- a/tun/netstack/tun.go +++ b/tun/netstack/tun.go @@ -167,6 +167,7 @@ func (tun *netTun) WriteNotify() { func (tun *netTun) Close() error { tun.stack.RemoveNIC(1) + tun.stack.Close() if tun.events != nil { close(tun.events) -- 2.42.0