Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/ip_reass.c
Show First 20 Lines • Show All 626 Lines • ▼ Show 20 Lines | |||||
ipreass_cleanup(void *arg __unused, struct ifnet *ifp) | ipreass_cleanup(void *arg __unused, struct ifnet *ifp) | ||||
{ | { | ||||
struct ipq *fp, *temp; | struct ipq *fp, *temp; | ||||
struct mbuf *m; | struct mbuf *m; | ||||
int i; | int i; | ||||
KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__)); | KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__)); | ||||
CURVNET_SET_QUIET(ifp->if_vnet); | |||||
/* | /* | ||||
* Skip processing if IPv4 reassembly is not initialised or | * Skip processing if IPv4 reassembly is not initialised or | ||||
* torn down by ipreass_destroy(). | * torn down by ipreass_destroy(). | ||||
*/ | */ | ||||
if (V_ipq_zone == NULL) | if (V_ipq_zone == NULL) { | ||||
CURVNET_RESTORE(); | |||||
return; | return; | ||||
} | |||||
CURVNET_SET_QUIET(ifp->if_vnet); | |||||
for (i = 0; i < IPREASS_NHASH; i++) { | for (i = 0; i < IPREASS_NHASH; i++) { | ||||
IPQ_LOCK(i); | IPQ_LOCK(i); | ||||
/* Scan fragment list. */ | /* Scan fragment list. */ | ||||
TAILQ_FOREACH_SAFE(fp, &V_ipq[i].head, ipq_list, temp) { | TAILQ_FOREACH_SAFE(fp, &V_ipq[i].head, ipq_list, temp) { | ||||
for (m = fp->ipq_frags; m != NULL; m = m->m_nextpkt) { | for (m = fp->ipq_frags; m != NULL; m = m->m_nextpkt) { | ||||
/* clear no longer valid rcvif pointer */ | /* clear no longer valid rcvif pointer */ | ||||
if (m->m_pkthdr.rcvif == ifp) | if (m->m_pkthdr.rcvif == ifp) | ||||
m->m_pkthdr.rcvif = NULL; | m->m_pkthdr.rcvif = NULL; | ||||
▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines |