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

Function pf_cleanup

freebsd/netpfil/pf/pf.c:920–956  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

918}
919
920void
921pf_cleanup()
922{
923 struct pf_keyhash *kh;
924 struct pf_idhash *ih;
925 struct pf_srchash *sh;
926 struct pf_send_entry *pfse, *next;
927 u_int i;
928
929 for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= pf_hashmask;
930 i++, kh++, ih++) {
931 KASSERT(LIST_EMPTY(&kh->keys), ("%s: key hash not empty",
932 __func__));
933 KASSERT(LIST_EMPTY(&ih->states), ("%s: id hash not empty",
934 __func__));
935 mtx_destroy(&kh->lock);
936 mtx_destroy(&ih->lock);
937 }
938 free(V_pf_keyhash, M_PFHASH);
939 free(V_pf_idhash, M_PFHASH);
940
941 for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) {
942 KASSERT(LIST_EMPTY(&sh->nodes),
943 ("%s: source node hash not empty", __func__));
944 mtx_destroy(&sh->lock);
945 }
946 free(V_pf_srchash, M_PFHASH);
947
948 STAILQ_FOREACH_SAFE(pfse, &V_pf_sendqueue, pfse_next, next) {
949 m_freem(pfse->pfse_m);
950 free(pfse, M_PFTEMP);
951 }
952
953 uma_zdestroy(V_pf_sources_z);
954 uma_zdestroy(V_pf_state_z);
955 uma_zdestroy(V_pf_state_key_z);
956}
957
958static int
959pf_mtag_uminit(void *mem, int size, int how)

Callers 1

pf_unload_vnetFunction · 0.85

Calls 3

uma_zdestroyFunction · 0.85
freeFunction · 0.50
m_freemFunction · 0.50

Tested by

no test coverage detected