| 1042 | } |
| 1043 | |
| 1044 | static void |
| 1045 | ipsec_delete_tunnel(struct ipsec_softc *sc) |
| 1046 | { |
| 1047 | int i; |
| 1048 | |
| 1049 | sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); |
| 1050 | |
| 1051 | sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; |
| 1052 | if (sc->family != 0) { |
| 1053 | CK_LIST_REMOVE(sc, srchash); |
| 1054 | sc->family = 0; |
| 1055 | /* |
| 1056 | * Make sure that ipsec_if_input() will not do access |
| 1057 | * to softc's policies. |
| 1058 | */ |
| 1059 | IPSEC_WAIT(); |
| 1060 | |
| 1061 | key_unregister_ifnet(sc->sp, IPSEC_SPCOUNT); |
| 1062 | for (i = 0; i < IPSEC_SPCOUNT; i++) |
| 1063 | key_freesp(&sc->sp[i]); |
| 1064 | } |
| 1065 | } |
no test coverage detected