diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2012-09-18 08:16:34 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2012-09-18 08:16:34 +0000 |
commit | dd55ef6ccbdca47c30e6113568af799083af3ec1 (patch) | |
tree | 53aca334876b58c316af0bcaf2b795df3b2e6b64 /sys/net/route.c | |
parent | b259c04c18573abbb28e8dcad96a5972e95bfff0 (diff) |
Wrap rtable_add() and rtable_l2set() calls inside ifioctl() inside softnet,
as functions that modify routing information shouldn't be interruptable by
network traffic.
Also make sure that both of those functions assert that they are called
at softnet. I'm reasonably sure that there shouldn't be any, but if there
is any codepath that was missed, we're going to be here for another 4 days
to deal with any fallout.
While here, move the multitude of "int s" declarations inside ifioctl to
the beginning of the function.
okay claudio@
Diffstat (limited to 'sys/net/route.c')
-rw-r--r-- | sys/net/route.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index f23cd47cb3b..4533c371216 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.137 2012/07/13 20:27:25 claudio Exp $ */ +/* $OpenBSD: route.c,v 1.138 2012/09/18 08:16:33 blambert Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -225,10 +225,12 @@ route_init(void) } int -rtable_add(u_int id) /* must be called at splsoftnet */ +rtable_add(u_int id) { void *p, *q; + splsoftassert(IPL_SOFTNET); + if (id > RT_TABLEID_MAX) return (EINVAL); @@ -271,6 +273,8 @@ rtable_l2(u_int id) void rtable_l2set(u_int id, u_int parent) { + splsoftassert(IPL_SOFTNET); + if (!rtable_exists(id) || !rtable_exists(parent)) return; rt_tab2dom[id] = parent; |