| 1183 | } |
| 1184 | |
| 1185 | static void |
| 1186 | tuninit(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. |
no test coverage detected