diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-02-23 22:57:55 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-02-23 22:57:55 +0000 |
commit | 73b78f4e119a0423406b9e8dbd571b33216236a0 (patch) | |
tree | d2e0d0bdf7b676f64769be429fbc4f51ad875ae9 /sys/netinet/in_rmx.c | |
parent | ec90cbc7e39bc5cec4b33a3e0c0d5bbd088a5c2c (diff) | |
download | FreeBSD-src-73b78f4e119a0423406b9e8dbd571b33216236a0.zip FreeBSD-src-73b78f4e119a0423406b9e8dbd571b33216236a0.tar.gz |
In in_rtqkill(), assert the radix head lock, and pass RTF_RNH_LOCKED
to in_rtrequest(); the radix head lock is already acquired before
rnh_walktree is called in in_rtqtimo_one(). This avoids a recursive
acquisition that is no longer permitted in 8.x due to use of an rwlock
for the radix head lock.
Reported by: dikshie <dikshie at gmail.com>
MFC after: 3 days
Diffstat (limited to 'sys/netinet/in_rmx.c')
-rw-r--r-- | sys/netinet/in_rmx.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c index f9e9d98..fcb9c62 100644 --- a/sys/netinet/in_rmx.c +++ b/sys/netinet/in_rmx.c @@ -203,6 +203,8 @@ in_rtqkill(struct radix_node *rn, void *rock) struct rtentry *rt = (struct rtentry *)rn; int err; + RADIX_NODE_HEAD_WLOCK_ASSERT(ap->rnh); + if (rt->rt_flags & RTPRF_OURS) { ap->found++; @@ -213,7 +215,8 @@ in_rtqkill(struct radix_node *rn, void *rock) err = in_rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt), rt->rt_gateway, rt_mask(rt), - rt->rt_flags, 0, rt->rt_fibnum); + rt->rt_flags | RTF_RNH_LOCKED, 0, + rt->rt_fibnum); if (err) { log(LOG_WARNING, "in_rtqkill: error %d\n", err); } else { |