summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2005-07-25 17:05:37 +0000
committerume <ume@FreeBSD.org>2005-07-25 17:05:37 +0000
commit627296e11d48991f16f6ba53a71b7a65f55e3827 (patch)
tree323b001ed350684fc3b9a89d9476663b64bfb3cf /sys
parentb7400ec2b97be67dfb492d71ddd367283ec54c53 (diff)
downloadFreeBSD-src-627296e11d48991f16f6ba53a71b7a65f55e3827.zip
FreeBSD-src-627296e11d48991f16f6ba53a71b7a65f55e3827.tar.gz
restore locks which disappeared wrongly by my previous commit.
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/scope6.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netinet6/scope6.c b/sys/netinet6/scope6.c
index ca31098..67ebd6f 100644
--- a/sys/netinet6/scope6.c
+++ b/sys/netinet6/scope6.c
@@ -410,7 +410,11 @@ in6_setscope(in6, ifp, ret_id)
{
int scope;
u_int32_t zoneid = 0;
- struct scope6_id *sid = SID(ifp);
+ struct scope6_id *sid;
+
+ IF_AFDATA_LOCK(ifp);
+
+ sid = SID(ifp);
#ifdef DIAGNOSTIC
if (sid == NULL) { /* should not happen */
@@ -425,16 +429,19 @@ in6_setscope(in6, ifp, ret_id)
*/
if (IN6_IS_ADDR_LOOPBACK(in6)) {
if (!(ifp->if_flags & IFF_LOOPBACK))
+ IF_AFDATA_UNLOCK(ifp);
return (EINVAL);
else {
if (ret_id != NULL)
*ret_id = 0; /* there's no ambiguity */
+ IF_AFDATA_UNLOCK(ifp);
return (0);
}
}
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];
@@ -456,6 +463,8 @@ in6_setscope(in6, ifp, ret_id)
zoneid = 0; /* XXX: treat as global. */
break;
}
+ SCOPE6_UNLOCK();
+ IF_AFDATA_UNLOCK(ifp);
if (ret_id != NULL)
*ret_id = zoneid;
OpenPOWER on IntegriCloud