summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/net/if_tun.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 216d325..67fb74e 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -426,6 +426,7 @@ tunopen(struct cdev *dev, int flag, int mode, struct thread *td)
tp->tun_flags |= TUN_OPEN;
mtx_unlock(&tp->tun_mtx);
ifp = TUN2IFP(tp);
+ if_link_state_change(ifp, LINK_STATE_UP);
TUNDEBUG(ifp, "open\n");
return (0);
@@ -482,6 +483,7 @@ tunclose(struct cdev *dev, int foo, int bar, struct thread *td)
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
splx(s);
}
+ if_link_state_change(ifp, LINK_STATE_DOWN);
CURVNET_RESTORE();
funsetown(&tp->tun_sigio);
OpenPOWER on IntegriCloud