Skip to content

Commit 94dc310

Browse files
committed
netstack: in debug, close tun fd on EOF
1 parent 7af28fc commit 94dc310

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

intra/netstack/fdbased.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
"sync/atomic"
3535

3636
"github.com/celzero/firestack/intra/log"
37+
"github.com/celzero/firestack/intra/settings"
3738
"golang.org/x/sys/unix"
3839
"gvisor.dev/gvisor/pkg/buffer"
3940
"gvisor.dev/gvisor/pkg/sync"
@@ -250,7 +251,7 @@ func (e *endpoint) Swap(fd, mtu int) (err error) {
250251
go e.dispatchLoop(e.inboundDispatcher)
251252

252253
// TODO: should we let the previous dispatcher stop on EOF?
253-
if prev != nil {
254+
if prev != nil && !settings.Debug {
254255
go prev.stop()
255256
}
256257

0 commit comments

Comments
 (0)