summaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6.c16
-rw-r--r--sys/netinet6/nd6_rtr.c9
2 files changed, 14 insertions, 11 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 6174d47b06c..1c6faae9cd1 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.c,v 1.140 2014/08/26 21:44:29 florian Exp $ */
+/* $OpenBSD: in6.c,v 1.141 2014/10/07 08:47:28 mpi Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
@@ -172,7 +172,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp)
struct in6_ifaddr *ia6 = NULL;
struct in6_aliasreq *ifra = (struct in6_aliasreq *)data;
struct sockaddr_in6 *sa6;
- int privileged;
+ int s, privileged;
privileged = 0;
if ((so->so_state & SS_PRIV) != 0)
@@ -463,7 +463,6 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp)
{
int i, error = 0;
struct nd_prefix pr0, *pr;
- int s;
/* reject read-only flags */
if ((ifra->ifra_flags & IN6_IFF_DUPLICATED) != 0 ||
@@ -561,8 +560,10 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp)
}
case SIOCDIFADDR_IN6:
+ s = splsoftnet();
in6_purgeaddr(&ia6->ia_ifa);
dohooks(ifp->if_addrhooks, 0);
+ splx(s);
break;
default:
@@ -1078,7 +1079,7 @@ in6_purgeaddr(struct ifaddr *ifa)
void
in6_unlink_ifa(struct in6_ifaddr *ia6, struct ifnet *ifp)
{
- int s = splnet();
+ splsoftassert(IPL_SOFTNET);
ifa_del(ifp, &ia6->ia_ifa);
@@ -1107,8 +1108,6 @@ in6_unlink_ifa(struct in6_ifaddr *ia6, struct ifnet *ifp)
* Note that we should decrement the refcnt at least once for all *BSD.
*/
ifafree(&ia6->ia_ifa);
-
- splx(s);
}
/*
@@ -1355,9 +1354,10 @@ int
in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia6, int newhost)
{
int error = 0, plen, ifacount = 0;
- int s = splnet();
struct ifaddr *ifa;
+ splsoftassert(IPL_SOFTNET);
+
/*
* Give the interface a chance to initialize
* if this is its first address (or it is a CARP interface)
@@ -1374,10 +1374,8 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia6, int newhost)
if ((ifacount <= 1 || ifp->if_type == IFT_CARP ||
(ifp->if_flags & IFF_POINTOPOINT)) && ifp->if_ioctl &&
(error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia6))) {
- splx(s);
return (error);
}
- splx(s);
ia6->ia_ifa.ifa_metric = ifp->if_metric;
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 3fe355e249a..4ef50837cb6 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_rtr.c,v 1.87 2014/09/09 20:33:24 dlg Exp $ */
+/* $OpenBSD: nd6_rtr.c,v 1.88 2014/10/07 08:47:28 mpi Exp $ */
/* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */
/*
@@ -990,6 +990,8 @@ purge_detached(struct ifnet *ifp)
struct in6_ifaddr *ia6;
struct ifaddr *ifa, *ifa_next;
+ splsoftassert(IPL_SOFTNET);
+
LIST_FOREACH_SAFE(pr, &nd_prefix, ndpr_entry, pr_next) {
/*
* This function is called when we need to make more room for
@@ -1025,8 +1027,11 @@ nd6_prelist_add(struct nd_prefix *pr, struct nd_defrouter *dr,
struct in6_ifextra *ext = pr->ndpr_ifp->if_afdata[AF_INET6];
if (ip6_maxifprefixes >= 0) {
- if (ext->nprefixes >= ip6_maxifprefixes / 2)
+ if (ext->nprefixes >= ip6_maxifprefixes / 2) {
+ s = splsoftnet();
purge_detached(pr->ndpr_ifp);
+ splx(s);
+ }
if (ext->nprefixes >= ip6_maxifprefixes)
return(ENOMEM);
}