summaryrefslogtreecommitdiffstats
path: root/sys/net/rtsock.c
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-12-07 21:15:43 +0000
committerkmacy <kmacy@FreeBSD.org>2008-12-07 21:15:43 +0000
commit598b522b42d772cdb7895eda77507500d0507864 (patch)
tree16533ece1c017ec68e8457a3d70ddbcf41a9dec9 /sys/net/rtsock.c
parenteaa93f5a2f480f7198abc747e36a95b2e814d0e7 (diff)
downloadFreeBSD-src-598b522b42d772cdb7895eda77507500d0507864.zip
FreeBSD-src-598b522b42d772cdb7895eda77507500d0507864.tar.gz
- convert radix node head lock from mutex to rwlock
- make radix node head lock not recursive - fix LOR in rtexpunge - fix LOR in rtredirect Reviewed by: sam
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r--sys/net/rtsock.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 7662c8d..c3b268a 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -43,6 +43,7 @@
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/protosw.h>
+#include <sys/rwlock.h>
#include <sys/signalvar.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
@@ -554,11 +555,11 @@ route_output(struct mbuf *m, struct socket *so)
rnh = V_rt_tables[so->so_fibnum][info.rti_info[RTAX_DST]->sa_family];
if (rnh == NULL)
senderr(EAFNOSUPPORT);
- RADIX_NODE_HEAD_LOCK(rnh);
+ RADIX_NODE_HEAD_RLOCK(rnh);
rt = (struct rtentry *) rnh->rnh_lookup(info.rti_info[RTAX_DST],
info.rti_info[RTAX_NETMASK], rnh);
if (rt == NULL) { /* XXX looks bogus */
- RADIX_NODE_HEAD_UNLOCK(rnh);
+ RADIX_NODE_HEAD_RUNLOCK(rnh);
senderr(ESRCH);
}
#ifdef RADIX_MPATH
@@ -574,14 +575,14 @@ route_output(struct mbuf *m, struct socket *so)
(rtm->rtm_type != RTM_GET || info.rti_info[RTAX_GATEWAY])) {
rt = rt_mpath_matchgate(rt, info.rti_info[RTAX_GATEWAY]);
if (!rt) {
- RADIX_NODE_HEAD_UNLOCK(rnh);
+ RADIX_NODE_HEAD_RUNLOCK(rnh);
senderr(ESRCH);
}
}
#endif
RT_LOCK(rt);
RT_ADDREF(rt);
- RADIX_NODE_HEAD_UNLOCK(rnh);
+ RADIX_NODE_HEAD_RUNLOCK(rnh);
/*
* Fix for PR: 82974
OpenPOWER on IntegriCloud