diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2009-01-30 10:47:47 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2009-01-30 10:47:47 +0000 |
commit | a9c9dbe15c7561168bb5d3b3aa0aed838b10e3b7 (patch) | |
tree | 2a6c7dc82683b14899c72379d28fb91397729095 /sys/netinet6/in6.c | |
parent | b70b43a89738bd0bd87a48b6266ef3cc91848910 (diff) |
"XXX: should this be performed under splnet()?"... Yes, yes it should.
Interface configuration causes neighbour discoverery, which runs packets
through parts of the stack that require at least splsoftnet(), like pf and
pfsync.
ok dlg
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r-- | sys/netinet6/in6.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index f729b1ec5fb..eda7a3a5514 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.79 2008/10/01 21:17:06 claudio Exp $ */ +/* $OpenBSD: in6.c,v 1.80 2009/01/30 10:47:46 mcbride Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -619,6 +619,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, { int i, error = 0; struct nd_prefix pr0, *pr; + int s; /* reject read-only flags */ if ((ifra->ifra_flags & IN6_IFF_DUPLICATED) != 0 || @@ -631,7 +632,10 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, * first, make or update the interface address structure, * and link it to the list. */ - if ((error = in6_update_ifa(ifp, ifra, ia)) != 0) + s = splsoftnet(); + error = in6_update_ifa(ifp, ifra, ia); + splx(s); + if (error != 0) return (error); if ((ia = in6ifa_ifpwithaddr(ifp, &ifra->ifra_addr.sin6_addr)) == NULL) { @@ -765,7 +769,6 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, * Update parameters of an IPv6 interface address. * If necessary, a new entry is created and linked into address chains. * This function is separated from in6_control(). - * XXX: should this be performed under splnet()? */ int in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra, @@ -778,6 +781,8 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra, struct in6_multi_mship *imm; struct rtentry *rt; + splassert(IPL_SOFTNET); + /* Validate parameters */ if (ifp == NULL || ifra == NULL) /* this maybe redundant */ return (EINVAL); |