Skip to content

Commit 1b31c86

Browse files
committed
tunnel: wireup ownership info to netstack
1 parent 71e7795 commit 1b31c86

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tunnel/tunnel.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"fmt"
3030
"os"
3131
"path/filepath"
32+
"strconv"
3233
"sync"
3334
"sync/atomic"
3435
"syscall"
@@ -189,13 +190,15 @@ func NewGTunnel(pctx context.Context, fd, mtu int, l3 string, hdl netstack.GConn
189190
}
190191
netstack.Route(stack, l3)
191192

193+
who := strconv.Itoa(ep.Cur())
194+
192195
var nic tcpip.NICID
193196
// Enabled() may temporarily return false when Up() is in progress.
194-
if nic, err = netstack.Up(stack, ep, hdl); err != nil { // attach new endpoint
197+
if nic, err = netstack.Up(who, stack, ep, hdl); err != nil { // attach new endpoint
195198
return nil, nil, err
196199
}
197200

198-
rev = netstack.NewReverseGConnHandler(pctx, stack, nic, ep, hdl)
201+
rev = netstack.NewReverseGConnHandler(who, pctx, stack, nic, ep, hdl)
199202

200203
log.I("tun: new netstack(%d) up; fd(%d=>%d), mtu(%d)", nic, fd, dupfd, mtu)
201204

0 commit comments

Comments
 (0)