summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_rmx.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-12-21 17:25:52 +0000
committerwollman <wollman@FreeBSD.org>1994-12-21 17:25:52 +0000
commit408291338b0a20c62dee204fc7ec24a18838d5d4 (patch)
treefc44babf7f416cf9ab2182f4b39a93ae5f8fb0a4 /sys/netinet/in_rmx.c
parentfc1509a009c04ccb08ad290842a91217efeacff5 (diff)
downloadFreeBSD-src-408291338b0a20c62dee204fc7ec24a18838d5d4.zip
FreeBSD-src-408291338b0a20c62dee204fc7ec24a18838d5d4.tar.gz
Avoid a serious race by blocking netisrs while walking the route tree.
(IWBRNI we could just block IP netisrs...)
Diffstat (limited to 'sys/netinet/in_rmx.c')
-rw-r--r--sys/netinet/in_rmx.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c
index aa33417..a007f71 100644
--- a/sys/netinet/in_rmx.c
+++ b/sys/netinet/in_rmx.c
@@ -4,7 +4,7 @@
* You may copy this file verbatim until I find the official
* Institute boilerplate.
*
- * $Id: in_rmx.c,v 1.5 1994/12/02 23:10:32 wollman Exp $
+ * $Id: in_rmx.c,v 1.6 1994/12/13 22:32:45 wollman Exp $
*/
/*
@@ -20,10 +20,6 @@
* indefinitely. See in_rtqtimo() below for the exact mechanism.
*/
-/*
- * XXX - look for races
- */
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -158,12 +154,15 @@ in_rtqtimo(void *rock)
struct radix_node_head *rnh = rock;
struct rtqk_arg arg;
struct timeval atv;
+ int s;
arg.found = arg.killed = 0;
arg.rnh = rnh;
arg.nextstop = time.tv_sec + 10*rtq_timeout;
arg.draining = 0;
+ s = splnet();
rnh->rnh_walktree(rnh, in_rtqkill, &arg);
+ splx(s);
atv.tv_usec = 0;
atv.tv_sec = arg.nextstop;
timeout(in_rtqtimo, rock, hzto(&atv));
@@ -174,11 +173,12 @@ in_rtqdrain(void)
{
struct radix_node_head *rnh = rt_tables[AF_INET];
struct rtqk_arg arg;
- int s = splnet();
+ int s;
arg.found = arg.killed = 0;
arg.rnh = rnh;
arg.nextstop = 0;
arg.draining = 1;
+ s = splnet();
rnh->rnh_walktree(rnh, in_rtqkill, &arg);
splx(s);
}
OpenPOWER on IntegriCloud