From 3b6049b8e5c5521c7526673920ba6a3fbf174f7d Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Thu, 29 Dec 2016 12:17:23 +0000 Subject: Get rid of recursive splsoftnet() in in6_ifattach_linklocal(). ok visa@ --- sys/netinet6/in6_ifattach.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'sys/netinet6/in6_ifattach.c') 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); } -- cgit v1.2.3