Skip to content

Commit 37b26a3

Browse files
authored
netstack/fdbased: dispatch tun reads iff nic is attached
1 parent 47bf93b commit 37b26a3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

intra/netstack/fdbased.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,9 @@ func (e *endpoint) Swap(fd, mtu int) (err error) {
259259
if err != nil {
260260
return fmt.Errorf("createInboundDispatcher(...) = %v", err)
261261
}
262-
go e.dispatchLoop(e.inboundDispatcher)
263-
262+
if e.dispatcher != nil { // attached?
263+
go e.dispatchLoop(e.inboundDispatcher)
264+
}
264265
return nil
265266
}
266267

0 commit comments

Comments
 (0)