Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Apr 2014 11:17:30 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r264722 - stable/10/sys/netinet6
Message-ID:  <201404211117.s3LBHUDL088445@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Mon Apr 21 11:17:29 2014
New Revision: 264722
URL: http://svnweb.freebsd.org/changeset/base/264722

Log:
  MFC r264364:
    Properly release the in6_multi lock.
  
  Sponsored by:	Yandex LLC

Modified:
  stable/10/sys/netinet6/in6_mcast.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet6/in6_mcast.c
==============================================================================
--- stable/10/sys/netinet6/in6_mcast.c	Mon Apr 21 09:43:22 2014	(r264721)
+++ stable/10/sys/netinet6/in6_mcast.c	Mon Apr 21 11:17:29 2014	(r264722)
@@ -1449,16 +1449,15 @@ in6p_block_unblock_source(struct inpcb *
 
 	CTR1(KTR_MLD, "%s: merge inm state", __func__);
 	error = in6m_merge(inm, imf);
-	if (error) {
+	if (error)
 		CTR1(KTR_MLD, "%s: failed to merge inm state", __func__);
-		goto out_im6f_rollback;
+	else {
+		CTR1(KTR_MLD, "%s: doing mld downcall", __func__);
+		error = mld_change_state(inm, 0);
+		if (error)
+			CTR1(KTR_MLD, "%s: failed mld downcall", __func__);
 	}
 
-	CTR1(KTR_MLD, "%s: doing mld downcall", __func__);
-	error = mld_change_state(inm, 0);
-	if (error)
-		CTR1(KTR_MLD, "%s: failed mld downcall", __func__);
-
 	IN6_MULTI_UNLOCK();
 
 out_im6f_rollback:
@@ -2046,29 +2045,27 @@ in6p_join_group(struct inpcb *inp, struc
 	if (is_new) {
 		error = in6_mc_join_locked(ifp, &gsa->sin6.sin6_addr, imf,
 		    &inm, 0);
-		if (error)
+		if (error) {
+			IN6_MULTI_UNLOCK();
 			goto out_im6o_free;
+		}
 		imo->im6o_membership[idx] = inm;
 	} else {
 		CTR1(KTR_MLD, "%s: merge inm state", __func__);
 		error = in6m_merge(inm, imf);
-		if (error) {
+		if (error)
 			CTR1(KTR_MLD, "%s: failed to merge inm state",
 			    __func__);
-			goto out_im6f_rollback;
-		}
-		CTR1(KTR_MLD, "%s: doing mld downcall", __func__);
-		error = mld_change_state(inm, 0);
-		if (error) {
-			CTR1(KTR_MLD, "%s: failed mld downcall",
-			    __func__);
-			goto out_im6f_rollback;
+		else {
+			CTR1(KTR_MLD, "%s: doing mld downcall", __func__);
+			error = mld_change_state(inm, 0);
+			if (error)
+				CTR1(KTR_MLD, "%s: failed mld downcall",
+				    __func__);
 		}
 	}
 
 	IN6_MULTI_UNLOCK();
-
-out_im6f_rollback:
 	INP_WLOCK_ASSERT(inp);
 	if (error) {
 		im6f_rollback(imf);
@@ -2295,23 +2292,20 @@ in6p_leave_group(struct inpcb *inp, stru
 	} else {
 		CTR1(KTR_MLD, "%s: merge inm state", __func__);
 		error = in6m_merge(inm, imf);
-		if (error) {
+		if (error)
 			CTR1(KTR_MLD, "%s: failed to merge inm state",
 			    __func__);
-			goto out_im6f_rollback;
-		}
-
-		CTR1(KTR_MLD, "%s: doing mld downcall", __func__);
-		error = mld_change_state(inm, 0);
-		if (error) {
-			CTR1(KTR_MLD, "%s: failed mld downcall",
-			    __func__);
+		else {
+			CTR1(KTR_MLD, "%s: doing mld downcall", __func__);
+			error = mld_change_state(inm, 0);
+			if (error)
+				CTR1(KTR_MLD, "%s: failed mld downcall",
+				    __func__);
 		}
 	}
 
 	IN6_MULTI_UNLOCK();
 
-out_im6f_rollback:
 	if (error)
 		im6f_rollback(imf);
 	else
@@ -2520,16 +2514,15 @@ in6p_set_source_filters(struct inpcb *in
 	 */
 	CTR1(KTR_MLD, "%s: merge inm state", __func__);
 	error = in6m_merge(inm, imf);
-	if (error) {
+	if (error)
 		CTR1(KTR_MLD, "%s: failed to merge inm state", __func__);
-		goto out_im6f_rollback;
+	else {
+		CTR1(KTR_MLD, "%s: doing mld downcall", __func__);
+		error = mld_change_state(inm, 0);
+		if (error)
+			CTR1(KTR_MLD, "%s: failed mld downcall", __func__);
 	}
 
-	CTR1(KTR_MLD, "%s: doing mld downcall", __func__);
-	error = mld_change_state(inm, 0);
-	if (error)
-		CTR1(KTR_MLD, "%s: failed mld downcall", __func__);
-
 	IN6_MULTI_UNLOCK();
 
 out_im6f_rollback:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404211117.s3LBHUDL088445>