From c2508034a22e0ffc005211d868759f78a4845284 Mon Sep 17 00:00:00 2001 From: "Alexander V. Chernikov" Date: Sun, 22 Apr 2012 16:13:23 +0000 Subject: [PATCH] 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 Approved by: kib(mentor) MFC after: 1 week --- sys/net/rtsock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 43539ba1223c..20f1de8579c1 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -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; }