MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tuninit

Function tuninit

freebsd/net/if_tuntap.c:1185–1205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1183}
1184
1185static void
1186tuninit(struct ifnet *ifp)
1187{
1188 struct tuntap_softc *tp = ifp->if_softc;
1189
1190 TUNDEBUG(ifp, "tuninit\n");
1191
1192 TUN_LOCK(tp);
1193 ifp->if_drv_flags |= IFF_DRV_RUNNING;
1194 if ((tp->tun_flags & TUN_L2) == 0) {
1195 ifp->if_flags |= IFF_UP;
1196 getmicrotime(&ifp->if_lastchange);
1197 TUN_UNLOCK(tp);
1198 } else {
1199 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
1200 TUN_UNLOCK(tp);
1201 /* attempt to start output */
1202 tunstart_l2(ifp);
1203 }
1204
1205}
1206
1207/*
1208 * Used only for l2 tunnel.

Callers 2

tunifinitFunction · 0.85
tunifioctlFunction · 0.85

Calls 2

getmicrotimeFunction · 0.85
tunstart_l2Function · 0.85

Tested by

no test coverage detected