Skip to content

Commit 6c8a0b7

Browse files
kshangxpinkisemils
authored andcommitted
Fix leak in netstack's tunnel
The upstream netstack's virtual tunnel device has a leaky Close implementation - the virtual network is not being shut down properly. What's missing is this one line change to shut down all the go routines associated with the userspace networking stack. This change is verbatim copied from kshangx's PR - WireGuard/wireguard-go#101 Signed-off-by: kshangx <[email protected]>
1 parent f4bc3ae commit 6c8a0b7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tun/netstack/tun.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ func (tun *netTun) Flush() error {
157157

158158
func (tun *netTun) Close() error {
159159
tun.stack.RemoveNIC(1)
160+
tun.stack.Close()
160161

161162
if tun.events != nil {
162163
close(tun.events)

0 commit comments

Comments
 (0)