| 2873 | } |
| 2874 | |
| 2875 | static void |
| 2876 | key_delsah(struct secashead *sah) |
| 2877 | { |
| 2878 | IPSEC_ASSERT(sah != NULL, ("NULL sah")); |
| 2879 | IPSEC_ASSERT(sah->state == SADB_SASTATE_DEAD, |
| 2880 | ("Attempt to free non DEAD SAH %p", sah)); |
| 2881 | IPSEC_ASSERT(TAILQ_EMPTY(&sah->savtree_larval), |
| 2882 | ("Attempt to free SAH %p with LARVAL SA", sah)); |
| 2883 | IPSEC_ASSERT(TAILQ_EMPTY(&sah->savtree_alive), |
| 2884 | ("Attempt to free SAH %p with ALIVE SA", sah)); |
| 2885 | |
| 2886 | free(sah, M_IPSEC_SAH); |
| 2887 | } |
| 2888 | |
| 2889 | /* |
| 2890 | * allocating a new SA for key_add() and key_getspi() call, |