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 <dikshie at gmail.com>
  
  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 {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to