From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 16 18:02:01 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BD331065680; Mon, 16 Mar 2009 18:02:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 279188FC16; Mon, 16 Mar 2009 18:02:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GI21ek068385; Mon, 16 Mar 2009 18:02:01 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GI2179068384; Mon, 16 Mar 2009 18:02:01 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903161802.n2GI2179068384@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Mar 2009 18:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189895 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2009 18:02:02 -0000 Author: rwatson Date: Mon Mar 16 18:02:00 2009 New Revision: 189895 URL: http://svn.freebsd.org/changeset/base/189895 Log: Merge r188962 from head to stable/7: 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 While not strictly required in 7.x, I am merging this to keep locking as consistent as possible in the routing code between 7.x and 8.x. Note that because the rwlock change has not been merged, this becomes LOCK_ASSERT rather than WLOCK_ASSERT. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/in_rmx.c Modified: stable/7/sys/netinet/in_rmx.c ============================================================================== --- stable/7/sys/netinet/in_rmx.c Mon Mar 16 17:57:29 2009 (r189894) +++ stable/7/sys/netinet/in_rmx.c Mon Mar 16 18:02:00 2009 (r189895) @@ -219,6 +219,8 @@ in_rtqkill(struct radix_node *rn, void * struct rtentry *rt = (struct rtentry *)rn; int err; + RADIX_NODE_HEAD_LOCK_ASSERT(ap->rnh); + if (rt->rt_flags & RTPRF_OURS) { ap->found++; @@ -229,7 +231,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 {