Module Name: src
Committed By: ozaki-r
Date: Wed Feb 22 07:05:47 UTC 2017
Modified Files:
src/sys/netinet6: nd6_rtr.c
Log Message:
Get rid of unnecessary splsoftnet
To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/netinet6/nd6_rtr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netinet6/nd6_rtr.c
diff -u src/sys/netinet6/nd6_rtr.c:1.132 src/sys/netinet6/nd6_rtr.c:1.133
--- src/sys/netinet6/nd6_rtr.c:1.132 Wed Feb 22 03:02:55 2017
+++ src/sys/netinet6/nd6_rtr.c Wed Feb 22 07:05:47 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: nd6_rtr.c,v 1.132 2017/02/22 03:02:55 ozaki-r Exp $ */
+/* $NetBSD: nd6_rtr.c,v 1.133 2017/02/22 07:05:47 ozaki-r Exp $ */
/* $KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.132 2017/02/22 03:02:55 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.133 2017/02/22 07:05:47 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -463,7 +463,6 @@ defrouter_addreq(struct nd_defrouter *ne
struct sockaddr_in6 sin6;
struct sockaddr sa;
} def, mask, gate;
- int s;
int error;
memset(&def, 0, sizeof(def));
@@ -478,14 +477,15 @@ defrouter_addreq(struct nd_defrouter *ne
gate.sin6.sin6_scope_id = 0; /* XXX */
#endif
- s = splsoftnet();
+#ifndef NET_MPSAFE
+ KASSERT(mutex_owned(softnet_lock));
+#endif
error = rtrequest_newmsg(RTM_ADD, &def.sa, &gate.sa, &mask.sa,
RTF_GATEWAY);
if (error == 0) {
nd6_numroutes++;
newdr->installed = 1;
}
- splx(s);
return;
}
@@ -956,7 +956,7 @@ nd6_prelist_add(struct nd_prefixctl *prc
struct nd_prefix **newp)
{
struct nd_prefix *newpr = NULL;
- int i, s;
+ int i;
int error;
struct in6_ifextra *ext = prc->ndprc_ifp->if_afdata[AF_INET6];
@@ -996,10 +996,8 @@ nd6_prelist_add(struct nd_prefixctl *prc
newpr->ndpr_mask.s6_addr32[i];
}
- s = splsoftnet();
/* link ndpr_entry to nd_prefix list */
ND_PREFIX_LIST_INSERT_HEAD(newpr);
- splx(s);
/* ND_OPT_PI_FLAG_ONLINK processing */
if (newpr->ndpr_raf_onlink) {
@@ -1067,7 +1065,6 @@ void
nd6_prelist_remove(struct nd_prefix *pr)
{
struct nd_pfxrouter *pfr, *next;
- int s;
struct in6_ifextra *ext = pr->ndpr_ifp->if_afdata[AF_INET6];
ND6_ASSERT_WLOCK();
@@ -1075,7 +1072,6 @@ nd6_prelist_remove(struct nd_prefix *pr)
nd6_invalidate_prefix(pr);
- s = splsoftnet();
/* unlink ndpr_entry from nd_prefix list */
ND_PREFIX_LIST_REMOVE(pr);
@@ -1093,7 +1089,6 @@ nd6_prelist_remove(struct nd_prefix *pr)
"%s\n", pr->ndpr_ifp->if_xname);
}
}
- splx(s);
free(pr, M_IP6NDP);
@@ -2222,16 +2217,16 @@ in6_init_address_ltimes(struct nd_prefix
void
nd6_rt_flush(struct in6_addr *gateway, struct ifnet *ifp)
{
- int s = splsoftnet();
+
+#ifndef NET_MPSAFE
+ KASSERT(mutex_owned(softnet_lock));
+#endif
/* We'll care only link-local addresses */
- if (!IN6_IS_ADDR_LINKLOCAL(gateway)) {
- splx(s);
+ if (!IN6_IS_ADDR_LINKLOCAL(gateway))
return;
- }
rt_delete_matched_entries(AF_INET6, rt6_deleteroute_matcher, gateway);
- splx(s);
}
static int