aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6/in6_mcast.c
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2018-05-21 13:08:44 +0000
committerEd Maste <emaste@FreeBSD.org>2018-05-21 13:08:44 +0000
commit3b9b6b1704393886b47526daa8df4d1a5525f281 (patch)
tree72f5f739f1fb950971888522a3e9fdd940099e9f /sys/netinet6/in6_mcast.c
parent785724755a740ee7f1521db49508be637451d591 (diff)
downloadsrc-3b9b6b1704393886b47526daa8df4d1a5525f281.tar.gz
src-3b9b6b1704393886b47526daa8df4d1a5525f281.zip
Notes
Diffstat (limited to 'sys/netinet6/in6_mcast.c')
-rw-r--r--sys/netinet6/in6_mcast.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c
index ba23b1d85de4..091d4d31b347 100644
--- a/sys/netinet6/in6_mcast.c
+++ b/sys/netinet6/in6_mcast.c
@@ -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);
}