summaryrefslogtreecommitdiff
path: root/sys/netinet/in.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-10-07 08:47:29 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-10-07 08:47:29 +0000
commit760f776a7ddeb43d69746282cc5b3f03a86d10d3 (patch)
tree985eee6f0952dc7bdebef9ab5347a2f9e92afd1c /sys/netinet/in.c
parentf65cbbd9acc27d42ed33838bbf0bac14a7b80b2b (diff)
Do not protect the SIOCSIFADDR call by splnet(). Drivers already
raise it inside their ioctl handler (except for carp(4), what else?). In general, global structures manipulated in the softnet codepath only require a splsoftnet() protection when they are modified in process (ioctl) context. Also put some IPL_SOFNET asserts in functions accessing global structures. Previous version diff ok mikeb@, with inputs from and ok bluhm@
Diffstat (limited to 'sys/netinet/in.c')
-rw-r--r--sys/netinet/in.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index 0725446536f..992b39c605a 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.c,v 1.105 2014/10/02 12:12:51 mpi Exp $ */
+/* $OpenBSD: in.c,v 1.106 2014/10/07 08:47:28 mpi Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
@@ -612,7 +612,7 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin,
{
u_int32_t i = sin->sin_addr.s_addr;
struct sockaddr_in oldaddr;
- int s, error = 0;
+ int error = 0;
splsoftassert(IPL_SOFTNET);
@@ -627,7 +627,6 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin,
rt_ifa_delloop(&ia->ia_ifa);
ifa_del(ifp, &ia->ia_ifa);
}
- s = splnet();
oldaddr = ia->ia_addr;
ia->ia_addr = *sin;
@@ -639,10 +638,8 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin,
if (ifp->if_ioctl &&
(error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia))) {
ia->ia_addr = oldaddr;
- splx(s);
goto out;
}
- splx(s);
if (ia->ia_netmask == 0) {
if (IN_CLASSA(i))