Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Feb 2009 22:57:55 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r188962 - head/sys/netinet
Message-ID:  <200902232257.n1NMvtgt042002@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rwatson
Date: Mon Feb 23 22:57:55 2009
New Revision: 188962
URL: http://svn.freebsd.org/changeset/base/188962

Log:
  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

Modified:
  head/sys/netinet/in_rmx.c

Modified: head/sys/netinet/in_rmx.c
==============================================================================
--- head/sys/netinet/in_rmx.c	Mon Feb 23 22:56:03 2009	(r188961)
+++ head/sys/netinet/in_rmx.c	Mon Feb 23 22:57:55 2009	(r188962)
@@ -203,6 +203,8 @@ in_rtqkill(struct radix_node *rn, void *
 	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 *
 			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 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902232257.n1NMvtgt042002>