Pair CURVNET_SET and CURVNET_RESTORE in a block
Per vnet(9), CURVNET_SET and CURVNET_RESTORE cannot be used as a single statement for a conditional and CURVNET_RESTORE must be in the same block as CURVNET_SET (or a subblock). Reviewed by: andrew Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
745aef8c6a
commit
3de0b917bf
@ -663,15 +663,17 @@ inm_release(struct in_multi *inm)
|
||||
|
||||
/* XXX this access is not covered by IF_ADDR_LOCK */
|
||||
CTR2(KTR_IGMPV3, "%s: purging ifma %p", __func__, ifma);
|
||||
if (ifp)
|
||||
if (ifp != NULL) {
|
||||
CURVNET_SET(ifp->if_vnet);
|
||||
inm_purge(inm);
|
||||
free(inm, M_IPMADDR);
|
||||
|
||||
if_delmulti_ifma_flags(ifma, 1);
|
||||
if (ifp) {
|
||||
inm_purge(inm);
|
||||
free(inm, M_IPMADDR);
|
||||
if_delmulti_ifma_flags(ifma, 1);
|
||||
CURVNET_RESTORE();
|
||||
if_rele(ifp);
|
||||
} else {
|
||||
inm_purge(inm);
|
||||
free(inm, M_IPMADDR);
|
||||
if_delmulti_ifma_flags(ifma, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1677,11 +1679,13 @@ inp_gcmoptions(epoch_context_t ctx)
|
||||
imf_leave(imf);
|
||||
inm = imo->imo_membership[idx];
|
||||
ifp = inm->inm_ifp;
|
||||
if (ifp)
|
||||
if (ifp != NULL) {
|
||||
CURVNET_SET(ifp->if_vnet);
|
||||
(void)in_leavegroup(inm, imf);
|
||||
if (ifp)
|
||||
(void)in_leavegroup(inm, imf);
|
||||
CURVNET_RESTORE();
|
||||
} else {
|
||||
(void)in_leavegroup(inm, imf);
|
||||
}
|
||||
if (imf)
|
||||
imf_purge(imf);
|
||||
}
|
||||
|
@ -539,15 +539,17 @@ in6m_release(struct in6_multi *inm)
|
||||
KASSERT(ifma->ifma_protospec == NULL,
|
||||
("%s: ifma_protospec != NULL", __func__));
|
||||
|
||||
if (ifp)
|
||||
if (ifp != NULL) {
|
||||
CURVNET_SET(ifp->if_vnet);
|
||||
in6m_purge(inm);
|
||||
free(inm, M_IP6MADDR);
|
||||
|
||||
if_delmulti_ifma_flags(ifma, 1);
|
||||
if (ifp) {
|
||||
in6m_purge(inm);
|
||||
free(inm, M_IP6MADDR);
|
||||
if_delmulti_ifma_flags(ifma, 1);
|
||||
CURVNET_RESTORE();
|
||||
if_rele(ifp);
|
||||
} else {
|
||||
in6m_purge(inm);
|
||||
free(inm, M_IP6MADDR);
|
||||
if_delmulti_ifma_flags(ifma, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1639,11 +1641,13 @@ inp_gcmoptions(epoch_context_t ctx)
|
||||
im6f_leave(imf);
|
||||
inm = imo->im6o_membership[idx];
|
||||
ifp = inm->in6m_ifp;
|
||||
if (ifp)
|
||||
if (ifp != NULL) {
|
||||
CURVNET_SET(ifp->if_vnet);
|
||||
(void)in6_leavegroup(inm, imf);
|
||||
if (ifp)
|
||||
(void)in6_leavegroup(inm, imf);
|
||||
CURVNET_RESTORE();
|
||||
} else {
|
||||
(void)in6_leavegroup(inm, imf);
|
||||
}
|
||||
if (imf)
|
||||
im6f_purge(imf);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user