summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2012-10-18 13:57:24 +0000
committerandre <andre@FreeBSD.org>2012-10-18 13:57:24 +0000
commit34a9a386cb4df8844bca8e43dae20e4a15710fcc (patch)
tree822857ae1f88eb65d6756450fb5600f0644b00d1 /sys/netinet6
parentbec3d0dcde51da4b3b1a5bc9fbea92a5353a57ed (diff)
downloadFreeBSD-src-34a9a386cb4df8844bca8e43dae20e4a15710fcc.zip
FreeBSD-src-34a9a386cb4df8844bca8e43dae20e4a15710fcc.tar.gz
Mechanically remove the last stray remains of spl* calls from net*/*.
They have been Noop's for a long time now.
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6.c9
-rw-r--r--sys/netinet6/ip6_ipsec.c10
-rw-r--r--sys/netinet6/nd6.c12
-rw-r--r--sys/netinet6/nd6_nbr.c4
-rw-r--r--sys/netinet6/nd6_rtr.c43
-rw-r--r--sys/netinet6/udp6_usrreq.c2
6 files changed, 10 insertions, 70 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index a7df9f8..7387204 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -995,7 +995,6 @@ cleanup:
* 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,
@@ -1522,7 +1521,6 @@ in6_purgeaddr(struct ifaddr *ifa)
static void
in6_unlink_ifa(struct in6_ifaddr *ia, struct ifnet *ifp)
{
- int s = splnet();
IF_ADDR_WLOCK(ifp);
TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link);
@@ -1560,7 +1558,6 @@ in6_unlink_ifa(struct in6_ifaddr *ia, struct ifnet *ifp)
pfxlist_onlink_check();
}
ifa_free(&ia->ia_ifa); /* in6_ifaddrhead */
- splx(s);
}
void
@@ -1856,7 +1853,6 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia,
struct sockaddr_in6 *sin6, int newhost)
{
int error = 0, plen, ifacount = 0;
- int s = splimp();
struct ifaddr *ifa;
/*
@@ -1876,12 +1872,9 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia,
if (ifacount <= 1 && ifp->if_ioctl) {
error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia);
- if (error) {
- splx(s);
+ if (error)
return (error);
- }
}
- splx(s);
ia->ia_ifa.ifa_metric = ifp->if_metric;
diff --git a/sys/netinet6/ip6_ipsec.c b/sys/netinet6/ip6_ipsec.c
index 21aafe1..b741cb1 100644
--- a/sys/netinet6/ip6_ipsec.c
+++ b/sys/netinet6/ip6_ipsec.c
@@ -128,9 +128,8 @@ ip6_ipsec_fwd(struct mbuf *m)
struct m_tag *mtag;
struct tdb_ident *tdbi;
struct secpolicy *sp;
- int s, error;
+ int error;
mtag = m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL);
- s = splnet();
if (mtag != NULL) {
tdbi = (struct tdb_ident *)(mtag + 1);
sp = ipsec_getpolicy(tdbi, IPSEC_DIR_INBOUND);
@@ -139,7 +138,6 @@ ip6_ipsec_fwd(struct mbuf *m)
IP_FORWARDING, &error);
}
if (sp == NULL) { /* NB: can happen if error */
- splx(s);
/*XXX error stat???*/
DPRINTF(("%s: no SP for forwarding\n", __func__)); /*XXX*/
return 1;
@@ -150,7 +148,6 @@ ip6_ipsec_fwd(struct mbuf *m)
*/
error = ipsec_in_reject(sp, m);
KEY_FREESP(&sp);
- splx(s);
if (error) {
V_ip6stat.ip6s_cantforward++;
return 1;
@@ -173,7 +170,7 @@ ip6_ipsec_input(struct mbuf *m, int nxt)
struct m_tag *mtag;
struct tdb_ident *tdbi;
struct secpolicy *sp;
- int s, error;
+ int error;
/*
* enforce IPsec policy checking if we are seeing last header.
* note that we do not visit this with protocols with pcb layer
@@ -189,7 +186,6 @@ ip6_ipsec_input(struct mbuf *m, int nxt)
* packet is returned to the ip input queue for delivery.
*/
mtag = m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL);
- s = splnet();
if (mtag != NULL) {
tdbi = (struct tdb_ident *)(mtag + 1);
sp = ipsec_getpolicy(tdbi, IPSEC_DIR_INBOUND);
@@ -209,7 +205,6 @@ ip6_ipsec_input(struct mbuf *m, int nxt)
DPRINTF(("%s: no SP, packet discarded\n", __func__));/*XXX*/
return 1;
}
- splx(s);
if (error)
return 1;
}
@@ -283,7 +278,6 @@ ip6_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error,
* done: below.
*/
KEY_FREESP(sp), *sp = NULL;
- /* XXX splx(s); */
goto done;
}
}
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 592eb90..1e2b43f 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -575,7 +575,6 @@ void
nd6_timer(void *arg)
{
CURVNET_SET((struct vnet *) arg);
- int s;
struct nd_defrouter *dr, *ndr;
struct nd_prefix *pr, *npr;
struct in6_ifaddr *ia6, *nia6;
@@ -584,7 +583,6 @@ nd6_timer(void *arg)
nd6_timer, curvnet);
/* expire default router list */
- s = splnet();
TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) {
if (dr->expire && dr->expire < time_second)
defrtrlist_del(dr);
@@ -679,7 +677,6 @@ nd6_timer(void *arg)
prelist_remove(pr);
}
}
- splx(s);
CURVNET_RESTORE();
}
@@ -1216,7 +1213,6 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
struct nd_defrouter *dr;
struct nd_prefix *pr;
int i = 0, error = 0;
- int s;
switch (cmd) {
case SIOCGDRLST_IN6:
@@ -1224,7 +1220,6 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
* obsolete API, use sysctl under net.inet6.icmp6
*/
bzero(drl, sizeof(*drl));
- s = splnet();
TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) {
if (i >= DRLSTSIZ)
break;
@@ -1237,7 +1232,6 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
drl->defrouter[i].if_index = dr->ifp->if_index;
i++;
}
- splx(s);
break;
case SIOCGPRLST_IN6:
/*
@@ -1253,7 +1247,6 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
* how about separating ioctls into two?
*/
bzero(oprl, sizeof(*oprl));
- s = splnet();
LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) {
struct nd_pfxrouter *pfr;
int j;
@@ -1299,7 +1292,6 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
i++;
}
- splx(s);
break;
case OSIOCGIFINFO_IN6:
@@ -1448,7 +1440,6 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
/* flush all the prefix advertised by routers */
struct nd_prefix *pr, *next;
- s = splnet();
LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, next) {
struct in6_ifaddr *ia, *ia_next;
@@ -1467,7 +1458,6 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
}
prelist_remove(pr);
}
- splx(s);
break;
}
case SIOCSRTRFLUSH_IN6:
@@ -1475,13 +1465,11 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
/* flush all the default routers */
struct nd_defrouter *dr, *next;
- s = splnet();
defrouter_reset();
TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, next) {
defrtrlist_del(dr);
}
defrouter_select();
- splx(s);
break;
}
case SIOCGNBRINFO_IN6:
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index a203558..42b4ad2 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1331,13 +1331,10 @@ static void
nd6_dad_timer(struct dadq *dp)
{
CURVNET_SET(dp->dad_vnet);
- int s;
struct ifaddr *ifa = dp->dad_ifa;
struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
char ip6buf[INET6_ADDRSTRLEN];
- s = splnet(); /* XXX */
-
/* Sanity check */
if (ia == NULL) {
log(LOG_ERR, "nd6_dad_timer: called with null parameter\n");
@@ -1424,7 +1421,6 @@ nd6_dad_timer(struct dadq *dp)
}
done:
- splx(s);
CURVNET_RESTORE();
}
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 792b5c9..f0bfcff 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -473,7 +473,6 @@ defrouter_addreq(struct nd_defrouter *new)
{
struct sockaddr_in6 def, mask, gate;
struct rtentry *newrt = NULL;
- int s;
int error;
bzero(&def, sizeof(def));
@@ -485,7 +484,6 @@ defrouter_addreq(struct nd_defrouter *new)
def.sin6_family = gate.sin6_family = AF_INET6;
gate.sin6_addr = new->rtaddr;
- s = splnet();
error = in6_rtrequest(RTM_ADD, (struct sockaddr *)&def,
(struct sockaddr *)&gate, (struct sockaddr *)&mask,
RTF_GATEWAY, &newrt, RT_DEFAULT_FIB);
@@ -495,7 +493,6 @@ defrouter_addreq(struct nd_defrouter *new)
}
if (error == 0)
new->installed = 1;
- splx(s);
return;
}
@@ -624,7 +621,6 @@ defrtrlist_del(struct nd_defrouter *dr)
void
defrouter_select(void)
{
- int s = splnet();
struct nd_defrouter *dr, *selected_dr = NULL, *installed_dr = NULL;
struct llentry *ln = NULL;
@@ -632,10 +628,8 @@ defrouter_select(void)
* Let's handle easy case (3) first:
* If default router list is empty, there's nothing to be done.
*/
- if (TAILQ_EMPTY(&V_nd_defrouter)) {
- splx(s);
+ if (TAILQ_EMPTY(&V_nd_defrouter))
return;
- }
/*
* Search for a (probably) reachable router from the list.
@@ -699,7 +693,6 @@ defrouter_select(void)
defrouter_addreq(selected_dr);
}
- splx(s);
return;
}
@@ -734,7 +727,6 @@ static struct nd_defrouter *
defrtrlist_update(struct nd_defrouter *new)
{
struct nd_defrouter *dr, *n;
- int s = splnet();
if ((dr = defrouter_lookup(&new->rtaddr, new->ifp)) != NULL) {
/* entry exists */
@@ -754,10 +746,8 @@ defrtrlist_update(struct nd_defrouter *new)
* to sort the entries. Also make sure the selected
* router is still installed in the kernel.
*/
- if (dr->installed && rtpref(new) == oldpref) {
- splx(s);
+ if (dr->installed && rtpref(new) == oldpref)
return (dr);
- }
/*
* preferred router may be changed, so relocate
@@ -772,21 +762,16 @@ defrtrlist_update(struct nd_defrouter *new)
n = dr;
goto insert;
}
- splx(s);
return (dr);
}
/* entry does not exist */
- if (new->rtlifetime == 0) {
- splx(s);
+ if (new->rtlifetime == 0)
return (NULL);
- }
n = (struct nd_defrouter *)malloc(sizeof(*n), M_IP6NDP, M_NOWAIT);
- if (n == NULL) {
- splx(s);
+ if (n == NULL)
return (NULL);
- }
bzero(n, sizeof(*n));
*n = *new;
@@ -810,8 +795,6 @@ insert:
defrouter_select();
- splx(s);
-
return (n);
}
@@ -874,7 +857,7 @@ nd6_prelist_add(struct nd_prefixctl *pr, struct nd_defrouter *dr,
{
struct nd_prefix *new = NULL;
int error = 0;
- int i, s;
+ int i;
char ip6buf[INET6_ADDRSTRLEN];
new = (struct nd_prefix *)malloc(sizeof(*new), M_IP6NDP, M_NOWAIT);
@@ -903,10 +886,8 @@ nd6_prelist_add(struct nd_prefixctl *pr, struct nd_defrouter *dr,
new->ndpr_prefix.sin6_addr.s6_addr32[i] &=
new->ndpr_mask.s6_addr32[i];
- s = splnet();
/* link ndpr_entry to nd_prefix list */
LIST_INSERT_HEAD(&V_nd_prefix, new, ndpr_entry);
- splx(s);
/* ND_OPT_PI_FLAG_ONLINK processing */
if (new->ndpr_raf_onlink) {
@@ -931,7 +912,7 @@ void
prelist_remove(struct nd_prefix *pr)
{
struct nd_pfxrouter *pfr, *next;
- int e, s;
+ int e;
char ip6buf[INET6_ADDRSTRLEN];
/* make sure to invalidate the prefix until it is really freed. */
@@ -956,8 +937,6 @@ prelist_remove(struct nd_prefix *pr)
if (pr->ndpr_refcnt > 0)
return; /* notice here? */
- s = splnet();
-
/* unlink ndpr_entry from nd_prefix list */
LIST_REMOVE(pr, ndpr_entry);
@@ -965,8 +944,6 @@ prelist_remove(struct nd_prefix *pr)
LIST_FOREACH_SAFE(pfr, &pr->ndpr_advrtrs, pfr_entry, next) {
free(pfr, M_IP6NDP);
}
- splx(s);
-
free(pr, M_IP6NDP);
pfxlist_onlink_check();
@@ -984,7 +961,6 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr,
struct ifaddr *ifa;
struct ifnet *ifp = new->ndpr_ifp;
struct nd_prefix *pr;
- int s = splnet();
int error = 0;
int newprefix = 0;
int auth;
@@ -1309,7 +1285,6 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr,
}
end:
- splx(s);
return error;
}
@@ -2112,13 +2087,10 @@ rt6_flush(struct in6_addr *gateway, struct ifnet *ifp)
{
struct radix_node_head *rnh;
u_int fibnum;
- int s = splnet();
/* We'll care only link-local addresses */
- if (!IN6_IS_ADDR_LINKLOCAL(gateway)) {
- splx(s);
+ if (!IN6_IS_ADDR_LINKLOCAL(gateway))
return;
- }
/* XXX Do we really need to walk any but the default FIB? */
for (fibnum = 0; fibnum < rt_numfibs; fibnum++) {
@@ -2130,7 +2102,6 @@ rt6_flush(struct in6_addr *gateway, struct ifnet *ifp)
rnh->rnh_walktree(rnh, rt6_deleteroute, (void *)gateway);
RADIX_NODE_HEAD_UNLOCK(rnh);
}
- splx(s);
}
static int
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index c43d958..1afe67b 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -644,8 +644,6 @@ udp6_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr6,
faddr = &sin6->sin6_addr;
/*
- * IPv4 version of udp_output calls in_pcbconnect in this case,
- * which needs splnet and affects performance.
* Since we saw no essential reason for calling in_pcbconnect,
* we get rid of such kind of logic, and call in6_selectsrc
* and in6_pcbsetport in order to fill in the local address
OpenPOWER on IntegriCloud