1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-05 12:56:08 +00:00

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
This commit is contained in:
Robert Watson 2009-02-23 22:57:55 +00:00
parent b92755d1d6
commit 63d0295c2f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=188962

View File

@ -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 {