Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Nov 2012 17:23:49 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243029 - head/sys/netinet6
Message-ID:  <201211141723.qAEHNn6A016369@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Wed Nov 14 17:23:48 2012
New Revision: 243029
URL: http://svnweb.freebsd.org/changeset/base/243029

Log:
  SCOPE6_LOCK protects V_sid_default, no need to acquire it without
  any access to V_sid_default.
  
  Sponsored by:	Yandex LLC
  MFC after:	1 week

Modified:
  head/sys/netinet6/scope6.c

Modified: head/sys/netinet6/scope6.c
==============================================================================
--- head/sys/netinet6/scope6.c	Wed Nov 14 17:14:03 2012	(r243028)
+++ head/sys/netinet6/scope6.c	Wed Nov 14 17:23:48 2012	(r243029)
@@ -139,7 +139,6 @@ scope6_set(struct ifnet *ifp, struct sco
 	 * interface addresses, routing table entries, PCB entries...
 	 */
 
-	SCOPE6_LOCK();
 	for (i = 0; i < 16; i++) {
 		if (idlist->s6id_list[i] &&
 		    idlist->s6id_list[i] != sid->s6id_list[i]) {
@@ -150,7 +149,6 @@ scope6_set(struct ifnet *ifp, struct sco
 			if (i == IPV6_ADDR_SCOPE_INTFACELOCAL &&
 			    idlist->s6id_list[i] != ifp->if_index) {
 				IF_AFDATA_UNLOCK(ifp);
-				SCOPE6_UNLOCK();
 				return (EINVAL);
 			}
 
@@ -163,7 +161,6 @@ scope6_set(struct ifnet *ifp, struct sco
 				 * safety in later use.
 				 */
 				IF_AFDATA_UNLOCK(ifp);
-				SCOPE6_UNLOCK();
 				return (EINVAL);
 			}
 
@@ -175,7 +172,6 @@ scope6_set(struct ifnet *ifp, struct sco
 			sid->s6id_list[i] = idlist->s6id_list[i];
 		}
 	}
-	SCOPE6_UNLOCK();
 	IF_AFDATA_UNLOCK(ifp);
 
 	return (error);
@@ -193,9 +189,7 @@ scope6_get(struct ifnet *ifp, struct sco
 		return (EINVAL);
 	}
 
-	SCOPE6_LOCK();
 	*idlist = *sid;
-	SCOPE6_UNLOCK();
 
 	IF_AFDATA_UNLOCK(ifp);
 	return (0);
@@ -442,8 +436,6 @@ in6_setscope(struct in6_addr *in6, struc
 	}
 
 	scope = in6_addrscope(in6);
-
-	SCOPE6_LOCK();
 	switch (scope) {
 	case IPV6_ADDR_SCOPE_INTFACELOCAL: /* should be interface index */
 		zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL];
@@ -465,7 +457,6 @@ in6_setscope(struct in6_addr *in6, struc
 		zoneid = 0;	/* XXX: treat as global. */
 		break;
 	}
-	SCOPE6_UNLOCK();
 	IF_AFDATA_UNLOCK(ifp);
 
 	if (ret_id != NULL)



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