summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-10-14 18:49:08 +0000
committersam <sam@FreeBSD.org>2003-10-14 18:49:08 +0000
commit5daf1cdd10e30bbb9d6d0a7e713d6d6bb25e4123 (patch)
treeb52e9daaadbba1d40781d2c78bcef592626f266e /sys/netinet6
parenta771df1391621609f941145ae1fe603c432afdf2 (diff)
downloadFreeBSD-src-5daf1cdd10e30bbb9d6d0a7e713d6d6bb25e4123.zip
FreeBSD-src-5daf1cdd10e30bbb9d6d0a7e713d6d6bb25e4123.tar.gz
MFp4: correct locking issues in nd6_lookup
Supported by: FreeBSD Foundation
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/nd6.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index b876f8a..be14f33 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -811,7 +811,6 @@ nd6_lookup(addr6, create, ifp)
RTFREE_LOCKED(rt);
rt = 0;
}
- RT_UNLOCK(rt);
}
if (!rt) {
if (create && ifp) {
@@ -846,6 +845,7 @@ nd6_lookup(addr6, create, ifp)
}
if (rt == NULL)
return (NULL);
+ RT_LOCK(rt);
if (rt->rt_llinfo) {
struct llinfo_nd6 *ln =
(struct llinfo_nd6 *)rt->rt_llinfo;
@@ -854,6 +854,7 @@ nd6_lookup(addr6, create, ifp)
} else
return (NULL);
}
+ RT_LOCK_ASSERT(rt);
rt->rt_refcnt--;
/*
* Validation for the entry.
@@ -877,8 +878,10 @@ nd6_lookup(addr6, create, ifp)
ifp ? if_name(ifp) : "unspec");
/* xxx more logs... kazu */
}
+ RT_UNLOCK(rt);
return (NULL);
}
+ RT_UNLOCK(rt); /* XXX not ready to return rt locked */
return (rt);
}
OpenPOWER on IntegriCloud