Author: melifaro
Date: Sun Apr 22 16:13:23 2012
New Revision: 234572
URL: http://svn.freebsd.org/changeset/base/234572

Log:
  Do not require radix write lock to be held while dumping route table
  via sysctl(4) interface. This permits router not to stop forwarding
  packets while route table is being written to user-supplied buffer.
  
  Reported by:        Pawel Tyll <pt...@nitronet.pl>
  Approved by:        kib(mentor)
  
  MFC after:          1 week

Modified:
  head/sys/net/rtsock.c

Modified: head/sys/net/rtsock.c
==============================================================================
--- head/sys/net/rtsock.c       Sun Apr 22 09:19:19 2012        (r234571)
+++ head/sys/net/rtsock.c       Sun Apr 22 16:13:23 2012        (r234572)
@@ -1884,10 +1884,10 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
                for (error = 0; error == 0 && i <= lim; i++) {
                        rnh = rt_tables_get_rnh(req->td->td_proc->p_fibnum, i);
                        if (rnh != NULL) {
-                               RADIX_NODE_HEAD_LOCK(rnh); 
+                               RADIX_NODE_HEAD_RLOCK(rnh); 
                                error = rnh->rnh_walktree(rnh,
                                    sysctl_dumpentry, &w);
-                               RADIX_NODE_HEAD_UNLOCK(rnh);
+                               RADIX_NODE_HEAD_RUNLOCK(rnh);
                        } else if (af != 0)
                                error = EAFNOSUPPORT;
                }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to