summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-08-24 16:00:17 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-08-24 16:00:17 +0000
commit6ec1f9f990e38130e29b67af2ffe384bae134e96 (patch)
tree518017b3d34e2e886fb85245508c0d8c1fec2da7
parentec1d323ba03e2aa433aee5c3fc49e29ff9d298f5 (diff)
Add a splnet() around a block that needs it for sure. Maybe more in
SIOCSIFRDOMAIN should be protected but this is by far the biggest offender. The same codepath in if_detach() runs at splnet().
-rw-r--r--sys/net/if.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 1ad04c99bb9..aea6b93be13 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.219 2010/07/31 20:48:32 blambert Exp $ */
+/* $OpenBSD: if.c,v 1.220 2010/08/24 16:00:16 claudio Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1496,6 +1496,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
/* remove all routing entries when switching domains */
/* XXX hell this is ugly */
if (ifr->ifr_rdomainid != ifp->if_rdomain) {
+ int s = splnet();
rt_if_remove(ifp);
#ifdef INET
rti_delete(ifp);
@@ -1525,6 +1526,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
IFAFREE(ifa);
}
#endif
+ splx(s);
}
/* Add interface to the specified rdomain */