summaryrefslogtreecommitdiff
path: root/sys/netinet6/in6_ifattach.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-12-29 12:17:23 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-12-29 12:17:23 +0000
commit3b6049b8e5c5521c7526673920ba6a3fbf174f7d (patch)
treefb766185125c06e7d17b9ed8311cdec71ef2c3ba /sys/netinet6/in6_ifattach.c
parent43d7b0d234e6f2b140d987dbcc6ab59002de6b84 (diff)
Get rid of recursive splsoftnet() in in6_ifattach_linklocal().
ok visa@
Diffstat (limited to 'sys/netinet6/in6_ifattach.c')
-rw-r--r--sys/netinet6/in6_ifattach.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c
index 048bc62e223..8ebd35026f0 100644
--- a/sys/netinet6/in6_ifattach.c
+++ b/sys/netinet6/in6_ifattach.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_ifattach.c,v 1.100 2016/06/30 08:19:03 mpi Exp $ */
+/* $OpenBSD: in6_ifattach.c,v 1.101 2016/12/29 12:17:22 mpi Exp $ */
/* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */
/*
@@ -294,7 +294,9 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct in6_addr *ifid)
{
struct in6_aliasreq ifra;
struct in6_ifaddr *ia6;
- int s, error, flags;
+ int error, flags;
+
+ splsoftassert(IPL_SOFTNET);
/*
* configure link-local address.
@@ -338,9 +340,7 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct in6_addr *ifid)
if (in6if_do_dad(ifp) && ((ifp->if_flags & IFF_POINTOPOINT) == 0))
ifra.ifra_flags |= IN6_IFF_TENTATIVE;
- s = splsoftnet();
error = in6_update_ifa(ifp, &ifra, in6ifa_ifpforlinklocal(ifp, 0));
- splx(s);
if (error != 0)
return (error);
@@ -359,15 +359,12 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct in6_addr *ifid)
if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
flags |= RTF_CLONING;
- s = splsoftnet();
error = rt_ifa_add(&ia6->ia_ifa, flags, ia6->ia_ifa.ifa_addr);
if (error) {
in6_purgeaddr(&ia6->ia_ifa);
- splx(s);
return (error);
}
dohooks(ifp->if_addrhooks, 0);
- splx(s);
return (0);
}