Skip to content

Commit 4694c0d

Browse files
committed
nilaway: tunnel/tunnel.go
1 parent 73e9492 commit 4694c0d

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

tunnel/tunnel.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,13 @@ func (t *gtunnel) SetRoute(engine int) error {
289289

290290
func (t *gtunnel) Stat() (*x.NetStat, error) {
291291
st, err := netstack.Stat(t.stack)
292-
st.TUNSt.Open = !t.closed.Load()
293-
st.TUNSt.Up = t.ep.IsAttached()
294-
st.TUNSt.Fd = t.ep.Cur()
295-
st.TUNSt.Mtu = int32(t.ep.MTU())
296-
st.TUNSt.PcapMode = t.pcapio.mode()
297292
if err == nil && st != nil {
293+
st.TUNSt.Open = !t.closed.Load()
294+
st.TUNSt.Up = t.ep.IsAttached()
295+
st.TUNSt.Fd = t.ep.Cur()
296+
st.TUNSt.Mtu = int32(t.ep.MTU())
297+
st.TUNSt.PcapMode = t.pcapio.mode()
298+
298299
if t := t.hdl.TCP(); t != nil {
299300
st.RDNSIn.OpenConnsTCP = t.OpenConns()
300301
}

0 commit comments

Comments
 (0)