summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/net/if.c26
-rw-r--r--sys/net/if_ef.c8
-rw-r--r--sys/net/if_gre.c3
-rw-r--r--sys/net/if_spppsubr.c61
-rw-r--r--sys/net/if_var.h2
-rw-r--r--sys/net/rtsock.c12
-rw-r--r--sys/netgraph/atm/ccatm/ng_ccatm.c3
-rw-r--r--sys/netgraph/atm/sscfu/ng_sscfu.c3
-rw-r--r--sys/netgraph/atm/sscop/ng_sscop.c3
-rw-r--r--sys/netgraph/atm/uni/ng_uni.c3
-rw-r--r--sys/netgraph/ng_eiface.c9
-rw-r--r--sys/netgraph/ng_ether.c7
-rw-r--r--sys/netgraph/ng_fec.c4
-rw-r--r--sys/netgraph/ng_gif.c9
-rw-r--r--sys/netgraph/ng_ksocket.c9
-rw-r--r--sys/netgraph/ng_source.c3
-rw-r--r--sys/netinet/ip_ipsec.c14
-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
-rw-r--r--sys/netipsec/key.c6
24 files changed, 29 insertions, 236 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 6a2812e..8b8c626 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -691,12 +691,9 @@ static void
if_attachdomain(void *dummy)
{
struct ifnet *ifp;
- int s;
- s = splnet();
TAILQ_FOREACH(ifp, &V_ifnet, if_link)
if_attachdomain1(ifp);
- splx(s);
}
SYSINIT(domainifattach, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_SECOND,
if_attachdomain, NULL);
@@ -705,21 +702,15 @@ static void
if_attachdomain1(struct ifnet *ifp)
{
struct domain *dp;
- int s;
-
- s = splnet();
/*
* Since dp->dom_ifattach calls malloc() with M_WAITOK, we
* cannot lock ifp->if_afdata initialization, entirely.
*/
- if (IF_AFDATA_TRYLOCK(ifp) == 0) {
- splx(s);
+ if (IF_AFDATA_TRYLOCK(ifp) == 0)
return;
- }
if (ifp->if_afdata_initialized >= domain_init_status) {
IF_AFDATA_UNLOCK(ifp);
- splx(s);
printf("if_attachdomain called more than once on %s\n",
ifp->if_xname);
return;
@@ -734,8 +725,6 @@ if_attachdomain1(struct ifnet *ifp)
ifp->if_afdata[dp->dom_family] =
(*dp->dom_ifattach)(ifp);
}
-
- splx(s);
}
/*
@@ -1825,7 +1814,6 @@ link_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
/*
* Mark an interface down and notify protocols of
* the transition.
- * NOTE: must be called at splnet or eqivalent.
*/
static void
if_unroute(struct ifnet *ifp, int flag, int fam)
@@ -1849,7 +1837,6 @@ if_unroute(struct ifnet *ifp, int flag, int fam)
/*
* Mark an interface up and notify protocols of
* the transition.
- * NOTE: must be called at splnet or eqivalent.
*/
static void
if_route(struct ifnet *ifp, int flag, int fam)
@@ -1935,7 +1922,6 @@ do_link_state_change(void *arg, int pending)
/*
* Mark an interface down and notify protocols of
* the transition.
- * NOTE: must be called at splnet or eqivalent.
*/
void
if_down(struct ifnet *ifp)
@@ -1947,7 +1933,6 @@ if_down(struct ifnet *ifp)
/*
* Mark an interface up and notify protocols of
* the transition.
- * NOTE: must be called at splnet or eqivalent.
*/
void
if_up(struct ifnet *ifp)
@@ -2150,14 +2135,10 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)
/* Smart drivers twiddle their own routes */
} else if (ifp->if_flags & IFF_UP &&
(new_flags & IFF_UP) == 0) {
- int s = splimp();
if_down(ifp);
- splx(s);
} else if (new_flags & IFF_UP &&
(ifp->if_flags & IFF_UP) == 0) {
- int s = splimp();
if_up(ifp);
- splx(s);
}
/* See if permanently promiscuous mode bit is about to flip */
if ((ifp->if_flags ^ new_flags) & IFF_PPROMISC) {
@@ -2605,11 +2586,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td)
if ((oif_flags ^ ifp->if_flags) & IFF_UP) {
#ifdef INET6
- if (ifp->if_flags & IFF_UP) {
- int s = splimp();
+ if (ifp->if_flags & IFF_UP)
in6_if_up(ifp);
- splx(s);
- }
#endif
}
if_rele(ifp);
diff --git a/sys/net/if_ef.c b/sys/net/if_ef.c
index 61f7cb7..8e84b07 100644
--- a/sys/net/if_ef.c
+++ b/sys/net/if_ef.c
@@ -151,14 +151,10 @@ static int
ef_detach(struct efnet *sc)
{
struct ifnet *ifp = sc->ef_ifp;
- int s;
-
- s = splimp();
ether_ifdetach(ifp);
if_free(ifp);
- splx(s);
return 0;
}
@@ -172,11 +168,10 @@ ef_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct efnet *sc = ifp->if_softc;
struct ifaddr *ifa = (struct ifaddr*)data;
- int s, error;
+ int error;
EFDEBUG("IOCTL %ld for %s\n", cmd, ifp->if_xname);
error = 0;
- s = splimp();
switch (cmd) {
case SIOCSIFFLAGS:
error = 0;
@@ -193,7 +188,6 @@ ef_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ether_ioctl(ifp, cmd, data);
break;
}
- splx(s);
return error;
}
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index 59e1a2a..0a0857b 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -518,7 +518,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct if_laddrreq *lifr = (struct if_laddrreq *)data;
struct in_aliasreq *aifr = (struct in_aliasreq *)data;
struct gre_softc *sc = ifp->if_softc;
- int s;
struct sockaddr_in si;
struct sockaddr *sa = NULL;
int error, adj;
@@ -528,7 +527,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = 0;
adj = 0;
- s = splnet();
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
@@ -848,7 +846,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
}
- splx(s);
return (error);
}
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 7c9c230..e5fbac90 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -791,13 +791,12 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
struct sppp *sp = IFP2SP(ifp);
struct ppp_header *h;
struct ifqueue *ifq = NULL;
- int s, error, rv = 0;
+ int error, rv = 0;
#ifdef INET
int ipproto = PPP_IP;
#endif
int debug = ifp->if_flags & IFF_DEBUG;
- s = splimp();
SPPP_LOCK(sp);
if (!(ifp->if_flags & IFF_UP) ||
@@ -808,7 +807,6 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
#endif
m_freem (m);
SPPP_UNLOCK(sp);
- splx (s);
return (ENETDOWN);
}
@@ -832,9 +830,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
* to start LCP for it.
*/
ifp->if_drv_flags |= IFF_DRV_RUNNING;
- splx(s);
lcp.Open(sp);
- s = splimp();
}
#ifdef INET
@@ -858,7 +854,6 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
{
m_freem(m);
SPPP_UNLOCK(sp);
- splx(s);
if(ip->ip_p == IPPROTO_TCP)
return(EADDRNOTAVAIL);
else
@@ -903,7 +898,6 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
default:
m_freem(m);
SPPP_UNLOCK(sp);
- splx(s);
return (EINVAL);
}
}
@@ -933,7 +927,6 @@ nobufs: if (debug)
SPP_ARGS(ifp));
++ifp->if_oerrors;
SPPP_UNLOCK(sp);
- splx (s);
return (ENOBUFS);
}
/*
@@ -1000,7 +993,6 @@ nobufs: if (debug)
m_freem (m);
++ifp->if_oerrors;
SPPP_UNLOCK(sp);
- splx (s);
return (EAFNOSUPPORT);
}
@@ -1016,11 +1008,9 @@ out:
if (error) {
++ifp->if_oerrors;
SPPP_UNLOCK(sp);
- splx (s);
return (rv? rv: ENOBUFS);
}
SPPP_UNLOCK(sp);
- splx (s);
/*
* Unlike in sppp_input(), we can always bump the timestamp
* here since sppp_output() is only called on behalf of
@@ -1137,14 +1127,12 @@ int
sppp_isempty(struct ifnet *ifp)
{
struct sppp *sp = IFP2SP(ifp);
- int empty, s;
+ int empty;
- s = splimp();
SPPP_LOCK(sp);
empty = !sp->pp_fastq.ifq_head && !sp->pp_cpq.ifq_head &&
!SP2IFP(sp)->if_snd.ifq_head;
SPPP_UNLOCK(sp);
- splx(s);
return (empty);
}
@@ -1156,9 +1144,7 @@ sppp_dequeue(struct ifnet *ifp)
{
struct sppp *sp = IFP2SP(ifp);
struct mbuf *m;
- int s;
- s = splimp();
SPPP_LOCK(sp);
/*
* Process only the control protocol queue until we have at
@@ -1175,7 +1161,6 @@ sppp_dequeue(struct ifnet *ifp)
IF_DEQUEUE (&SP2IFP(sp)->if_snd, m);
}
SPPP_UNLOCK(sp);
- splx(s);
return m;
}
@@ -1187,9 +1172,7 @@ sppp_pick(struct ifnet *ifp)
{
struct sppp *sp = IFP2SP(ifp);
struct mbuf *m;
- int s;
- s = splimp ();
SPPP_LOCK(sp);
m = sp->pp_cpq.ifq_head;
@@ -1200,7 +1183,6 @@ sppp_pick(struct ifnet *ifp)
if ((m = sp->pp_fastq.ifq_head) == NULL)
m = SP2IFP(sp)->if_snd.ifq_head;
SPPP_UNLOCK(sp);
- splx (s);
return (m);
}
@@ -1212,9 +1194,8 @@ sppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, void *data)
{
struct ifreq *ifr = (struct ifreq*) data;
struct sppp *sp = IFP2SP(ifp);
- int s, rv, going_up, going_down, newmode;
+ int rv, going_up, going_down, newmode;
- s = splimp();
SPPP_LOCK(sp);
rv = 0;
switch (cmd) {
@@ -1320,7 +1301,6 @@ sppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, void *data)
rv = ENOTTY;
}
SPPP_UNLOCK(sp);
- splx(s);
return rv;
}
@@ -2070,9 +2050,7 @@ static void
sppp_to_event(const struct cp *cp, struct sppp *sp)
{
STDDCL;
- int s;
- s = splimp();
SPPP_LOCK(sp);
if (debug)
log(LOG_DEBUG, SPP_FMT "%s TO(%s) rst_counter = %d\n",
@@ -2122,7 +2100,6 @@ sppp_to_event(const struct cp *cp, struct sppp *sp)
}
SPPP_UNLOCK(sp);
- splx(s);
}
/*
@@ -4025,7 +4002,7 @@ sppp_chap_input(struct sppp *sp, struct mbuf *m)
{
STDDCL;
struct lcp_header *h;
- int len, x;
+ int len;
u_char *value, *name, digest[AUTHKEYLEN], dsize;
int value_len, name_len;
MD5_CTX ctx;
@@ -4102,7 +4079,6 @@ sppp_chap_input(struct sppp *sp, struct mbuf *m)
}
log(-1, "\n");
}
- x = splimp();
SPPP_LOCK(sp);
sp->pp_flags &= ~PP_NEEDAUTH;
if (sp->myauth.proto == PPP_CHAP &&
@@ -4114,11 +4090,9 @@ sppp_chap_input(struct sppp *sp, struct mbuf *m)
* to network phase.
*/
SPPP_UNLOCK(sp);
- splx(x);
break;
}
SPPP_UNLOCK(sp);
- splx(x);
sppp_phase_network(sp);
break;
@@ -4280,9 +4254,7 @@ sppp_chap_TO(void *cookie)
{
struct sppp *sp = (struct sppp *)cookie;
STDDCL;
- int s;
- s = splimp();
SPPP_LOCK(sp);
if (debug)
log(LOG_DEBUG, SPP_FMT "chap TO(%s) rst_counter = %d\n",
@@ -4313,14 +4285,13 @@ sppp_chap_TO(void *cookie)
}
SPPP_UNLOCK(sp);
- splx(s);
}
static void
sppp_chap_tlu(struct sppp *sp)
{
STDDCL;
- int i, x;
+ int i;
i = 0;
sp->rst_counter[IDX_CHAP] = sp->lcp.max_configure;
@@ -4351,7 +4322,6 @@ sppp_chap_tlu(struct sppp *sp)
log(-1, "re-challenging supressed\n");
}
- x = splimp();
SPPP_LOCK(sp);
/* indicate to LCP that we need to be closed down */
sp->lcp.protos |= (1 << IDX_CHAP);
@@ -4363,11 +4333,9 @@ sppp_chap_tlu(struct sppp *sp)
* phase.
*/
SPPP_UNLOCK(sp);
- splx(x);
return;
}
SPPP_UNLOCK(sp);
- splx(x);
/*
* If we are already in phase network, we are done here. This
@@ -4436,7 +4404,7 @@ sppp_pap_input(struct sppp *sp, struct mbuf *m)
{
STDDCL;
struct lcp_header *h;
- int len, x;
+ int len;
u_char *name, *passwd, mlen;
int name_len, passwd_len;
@@ -4523,7 +4491,6 @@ sppp_pap_input(struct sppp *sp, struct mbuf *m)
}
log(-1, "\n");
}
- x = splimp();
SPPP_LOCK(sp);
sp->pp_flags &= ~PP_NEEDAUTH;
if (sp->myauth.proto == PPP_PAP &&
@@ -4535,11 +4502,9 @@ sppp_pap_input(struct sppp *sp, struct mbuf *m)
* to network phase.
*/
SPPP_UNLOCK(sp);
- splx(x);
break;
}
SPPP_UNLOCK(sp);
- splx(x);
sppp_phase_network(sp);
break;
@@ -4620,9 +4585,7 @@ sppp_pap_TO(void *cookie)
{
struct sppp *sp = (struct sppp *)cookie;
STDDCL;
- int s;
- s = splimp();
SPPP_LOCK(sp);
if (debug)
log(LOG_DEBUG, SPP_FMT "pap TO(%s) rst_counter = %d\n",
@@ -4648,7 +4611,6 @@ sppp_pap_TO(void *cookie)
}
SPPP_UNLOCK(sp);
- splx(s);
}
/*
@@ -4675,7 +4637,6 @@ static void
sppp_pap_tlu(struct sppp *sp)
{
STDDCL;
- int x;
sp->rst_counter[IDX_PAP] = sp->lcp.max_configure;
@@ -4683,7 +4644,6 @@ sppp_pap_tlu(struct sppp *sp)
log(LOG_DEBUG, SPP_FMT "%s tlu\n",
SPP_ARGS(ifp), pap.name);
- x = splimp();
SPPP_LOCK(sp);
/* indicate to LCP that we need to be closed down */
sp->lcp.protos |= (1 << IDX_PAP);
@@ -4695,11 +4655,9 @@ sppp_pap_tlu(struct sppp *sp)
* phase.
*/
SPPP_UNLOCK(sp);
- splx(x);
return;
}
SPPP_UNLOCK(sp);
- splx(x);
sppp_phase_network(sp);
}
@@ -4837,9 +4795,7 @@ sppp_keepalive(void *dummy)
{
struct sppp *sp = (struct sppp*)dummy;
struct ifnet *ifp = SP2IFP(sp);
- int s;
- s = splimp();
SPPP_LOCK(sp);
/* Keepalive mode disabled or channel down? */
if (! (sp->pp_flags & PP_KEEPALIVE) ||
@@ -4882,7 +4838,6 @@ sppp_keepalive(void *dummy)
}
out:
SPPP_UNLOCK(sp);
- splx(s);
callout_reset(&sp->keepalive_callout, hz * 10, sppp_keepalive,
(void *)sp);
}
@@ -4932,7 +4887,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_long *src, u_long *dst, u_long *srcmask)
#ifdef INET
/*
- * Set my IP address. Must be called at splimp.
+ * Set my IP address.
*/
static void
sppp_set_ip_addr(struct sppp *sp, u_long src)
@@ -5049,7 +5004,7 @@ sppp_gen_ip6_addr(struct sppp *sp, struct in6_addr *addr)
}
/*
- * Set my IPv6 address. Must be called at splimp.
+ * Set my IPv6 address.
*/
static void
sppp_set_ip6_addr(struct sppp *sp, const struct in6_addr *src)
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 6d1097e..2ec73e4 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -274,7 +274,7 @@ void if_maddr_runlock(struct ifnet *ifp); /* if_multiaddrs */
* Output queues (ifp->if_snd) and slow device input queues (*ifp->if_slowq)
* are queues of messages stored on ifqueue structures
* (defined above). Entries are added to and deleted from these structures
- * by these macros, which should be called with ipl raised to splimp().
+ * by these macros.
*/
#define IF_LOCK(ifq) mtx_lock(&(ifq)->ifq_mtx)
#define IF_UNLOCK(ifq) mtx_unlock(&(ifq)->ifq_mtx)
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 20f1de8..7454a9e 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -302,7 +302,7 @@ static int
rts_attach(struct socket *so, int proto, struct thread *td)
{
struct rawcb *rp;
- int s, error;
+ int error;
KASSERT(so->so_pcb == NULL, ("rts_attach: so_pcb != NULL"));
@@ -311,20 +311,11 @@ rts_attach(struct socket *so, int proto, struct thread *td)
if (rp == NULL)
return ENOBUFS;
- /*
- * The splnet() is necessary to block protocols from sending
- * error notifications (like RTM_REDIRECT or RTM_LOSING) while
- * this PCB is extant but incompletely initialized.
- * Probably we should try to do more of this work beforehand and
- * eliminate the spl.
- */
- s = splnet();
so->so_pcb = (caddr_t)rp;
so->so_fibnum = td->td_proc->p_fibnum;
error = raw_attach(so, proto);
rp = sotorawcb(so);
if (error) {
- splx(s);
so->so_pcb = NULL;
free(rp, M_PCB);
return error;
@@ -345,7 +336,6 @@ rts_attach(struct socket *so, int proto, struct thread *td)
RTSOCK_UNLOCK();
soisconnected(so);
so->so_options |= SO_USELOOPBACK;
- splx(s);
return 0;
}
diff --git a/sys/netgraph/atm/ccatm/ng_ccatm.c b/sys/netgraph/atm/ccatm/ng_ccatm.c
index 92e162c..a6ff474 100644
--- a/sys/netgraph/atm/ccatm/ng_ccatm.c
+++ b/sys/netgraph/atm/ccatm/ng_ccatm.c
@@ -1178,10 +1178,8 @@ ng_ccatm_log(const char *fmt, ...)
static int
ng_ccatm_mod_event(module_t mod, int event, void *data)
{
- int s;
int error = 0;
- s = splnet();
switch (event) {
case MOD_LOAD:
@@ -1194,6 +1192,5 @@ ng_ccatm_mod_event(module_t mod, int event, void *data)
error = EOPNOTSUPP;
break;
}
- splx(s);
return (error);
}
diff --git a/sys/netgraph/atm/sscfu/ng_sscfu.c b/sys/netgraph/atm/sscfu/ng_sscfu.c
index cca8198..45ccf49 100644
--- a/sys/netgraph/atm/sscfu/ng_sscfu.c
+++ b/sys/netgraph/atm/sscfu/ng_sscfu.c
@@ -587,10 +587,8 @@ sscfu_verbose(struct sscfu *sscfu, void *arg, const char *fmt, ...)
static int
ng_sscfu_mod_event(module_t mod, int event, void *data)
{
- int s;
int error = 0;
- s = splnet();
switch (event) {
case MOD_LOAD:
@@ -603,6 +601,5 @@ ng_sscfu_mod_event(module_t mod, int event, void *data)
error = EOPNOTSUPP;
break;
}
- splx(s);
return (error);
}
diff --git a/sys/netgraph/atm/sscop/ng_sscop.c b/sys/netgraph/atm/sscop/ng_sscop.c
index 729c818..67a3f07 100644
--- a/sys/netgraph/atm/sscop/ng_sscop.c
+++ b/sys/netgraph/atm/sscop/ng_sscop.c
@@ -861,10 +861,8 @@ sscop_send_manage(struct sscop *sscop, void *p, enum sscop_maasig sig,
static int
ng_sscop_mod_event(module_t mod, int event, void *data)
{
- int s;
int error = 0;
- s = splnet();
switch (event) {
case MOD_LOAD:
@@ -877,6 +875,5 @@ ng_sscop_mod_event(module_t mod, int event, void *data)
error = EOPNOTSUPP;
break;
}
- splx(s);
return (error);
}
diff --git a/sys/netgraph/atm/uni/ng_uni.c b/sys/netgraph/atm/uni/ng_uni.c
index 980b81a..7a3fe92 100644
--- a/sys/netgraph/atm/uni/ng_uni.c
+++ b/sys/netgraph/atm/uni/ng_uni.c
@@ -907,10 +907,8 @@ ng_uni_free(enum unimem type, void *ptr, const char *file, u_int lno)
static int
ng_uni_mod_event(module_t mod, int event, void *data)
{
- int s;
int error = 0;
- s = splnet();
switch(event) {
case MOD_LOAD:
@@ -925,6 +923,5 @@ ng_uni_mod_event(module_t mod, int event, void *data)
error = EOPNOTSUPP;
break;
}
- splx(s);
return (error);
}
diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c
index d761a6c..0f471bb 100644
--- a/sys/netgraph/ng_eiface.c
+++ b/sys/netgraph/ng_eiface.c
@@ -132,12 +132,11 @@ ng_eiface_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
{
const priv_p priv = (priv_p)ifp->if_softc;
struct ifreq *const ifr = (struct ifreq *)data;
- int s, error = 0;
+ int error = 0;
#ifdef DEBUG
ng_eiface_print_ioctl(ifp, command, data);
#endif
- s = splimp();
switch (command) {
/* These two are mostly handled at a higher layer */
@@ -193,7 +192,6 @@ ng_eiface_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = EINVAL;
break;
}
- splx(s);
return (error);
}
@@ -202,14 +200,9 @@ ng_eiface_init(void *xsc)
{
priv_p sc = xsc;
struct ifnet *ifp = sc->ifp;
- int s;
-
- s = splimp();
ifp->if_drv_flags |= IFF_DRV_RUNNING;
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-
- splx(s);
}
/*
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c
index ed928fe..05d2e6e 100644
--- a/sys/netgraph/ng_ether.c
+++ b/sys/netgraph/ng_ether.c
@@ -220,8 +220,6 @@ NETGRAPH_INIT(ether, &ng_ether_typestruct);
/*
* Handle a packet that has come in on an interface. We get to
* look at it here before any upper layer protocols do.
- *
- * NOTE: this function will get called at splimp()
*/
static void
ng_ether_input(struct ifnet *ifp, struct mbuf **mp)
@@ -239,8 +237,6 @@ ng_ether_input(struct ifnet *ifp, struct mbuf **mp)
/*
* Handle a packet that has come in on an interface, and which
* does not match any of our known protocols (an ``orphan'').
- *
- * NOTE: this function will get called at splimp()
*/
static void
ng_ether_input_orphan(struct ifnet *ifp, struct mbuf *m)
@@ -759,9 +755,7 @@ static int
ng_ether_mod_event(module_t mod, int event, void *data)
{
int error = 0;
- int s;
- s = splnet();
switch (event) {
case MOD_LOAD:
@@ -802,7 +796,6 @@ ng_ether_mod_event(module_t mod, int event, void *data)
error = EOPNOTSUPP;
break;
}
- splx(s);
return (error);
}
diff --git a/sys/netgraph/ng_fec.c b/sys/netgraph/ng_fec.c
index 53f59e7..459931a 100644
--- a/sys/netgraph/ng_fec.c
+++ b/sys/netgraph/ng_fec.c
@@ -753,7 +753,7 @@ static int
ng_fec_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
{
struct ifreq *const ifr = (struct ifreq *) data;
- int s, error = 0;
+ int error = 0;
struct ng_fec_private *priv;
struct ng_fec_bundle *b;
@@ -763,7 +763,6 @@ ng_fec_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
#ifdef DEBUG
ng_fec_print_ioctl(ifp, command, data);
#endif
- s = splimp();
switch (command) {
/* These two are mostly handled at a higher layer */
@@ -843,7 +842,6 @@ ng_fec_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = EINVAL;
break;
}
- (void) splx(s);
return (error);
}
diff --git a/sys/netgraph/ng_gif.c b/sys/netgraph/ng_gif.c
index 1790cbd..d362152 100644
--- a/sys/netgraph/ng_gif.c
+++ b/sys/netgraph/ng_gif.c
@@ -163,8 +163,6 @@ NETGRAPH_INIT(gif, &ng_gif_typestruct);
/*
* Handle a packet that has come in on an interface. We get to
* look at it here before any upper layer protocols do.
- *
- * NOTE: this function will get called at splimp()
*/
static void
ng_gif_input(struct ifnet *ifp, struct mbuf **mp, int af)
@@ -181,8 +179,6 @@ ng_gif_input(struct ifnet *ifp, struct mbuf **mp, int af)
/*
* Handle a packet that has come in on an interface, and which
* does not match any of our known protocols (an ``orphan'').
- *
- * NOTE: this function will get called at splimp()
*/
static void
ng_gif_input_orphan(struct ifnet *ifp, struct mbuf *m, int af)
@@ -203,8 +199,6 @@ ng_gif_input_orphan(struct ifnet *ifp, struct mbuf *m, int af)
/*
* Handle a packet that has come in on a gif interface.
* Attach the address family to the mbuf for later use.
- *
- * NOTE: this function will get called at splimp()
*/
static void
ng_gif_input2(node_p node, struct mbuf **mp, int af)
@@ -543,9 +537,7 @@ ng_gif_mod_event(module_t mod, int event, void *data)
VNET_ITERATOR_DECL(vnet_iter);
struct ifnet *ifp;
int error = 0;
- int s;
- s = splnet();
switch (event) {
case MOD_LOAD:
@@ -597,7 +589,6 @@ ng_gif_mod_event(module_t mod, int event, void *data)
error = EOPNOTSUPP;
break;
}
- splx(s);
return (error);
}
diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c
index cacb524..15c8ce0 100644
--- a/sys/netgraph/ng_ksocket.c
+++ b/sys/netgraph/ng_ksocket.c
@@ -1045,9 +1045,7 @@ ng_ksocket_incoming2(node_p node, hook_p hook, void *arg1, int arg2)
struct mbuf *m;
struct ng_mesg *response;
struct uio auio;
- int s, flags, error;
-
- s = splnet();
+ int flags, error;
/* so = priv->so; *//* XXX could have derived this like so */
KASSERT(so == priv->so, ("%s: wrong socket", __func__));
@@ -1094,10 +1092,8 @@ ng_ksocket_incoming2(node_p node, hook_p hook, void *arg1, int arg2)
* the hook gets created and is connected, this upcall function
* will be called again.
*/
- if (priv->hook == NULL) {
- splx(s);
+ if (priv->hook == NULL)
return;
- }
/* Read and forward available mbuf's */
auio.uio_td = NULL;
@@ -1165,7 +1161,6 @@ sendit: /* Forward data with optional peer sockaddr as packet tag */
}
priv->flags |= KSF_EOFSEEN;
}
- splx(s);
}
/*
diff --git a/sys/netgraph/ng_source.c b/sys/netgraph/ng_source.c
index e4ff1b3..83473f9 100644
--- a/sys/netgraph/ng_source.c
+++ b/sys/netgraph/ng_source.c
@@ -608,7 +608,6 @@ static int
ng_source_store_output_ifp(sc_p sc, char *ifname)
{
struct ifnet *ifp;
- int s;
ifp = ifunit(ifname);
@@ -624,13 +623,11 @@ ng_source_store_output_ifp(sc_p sc, char *ifname)
* interface with small packets.
* XXX we should restore the original value at stop or disconnect
*/
- s = splimp(); /* XXX is this required? */
if (ifp->if_snd.ifq_maxlen < NG_SOURCE_DRIVER_IFQ_MAXLEN) {
printf("ng_source: changing ifq_maxlen from %d to %d\n",
ifp->if_snd.ifq_maxlen, NG_SOURCE_DRIVER_IFQ_MAXLEN);
ifp->if_snd.ifq_maxlen = NG_SOURCE_DRIVER_IFQ_MAXLEN;
}
- splx(s);
#endif
return (0);
}
diff --git a/sys/netinet/ip_ipsec.c b/sys/netinet/ip_ipsec.c
index 7fc4c3f..965deb2 100644
--- a/sys/netinet/ip_ipsec.c
+++ b/sys/netinet/ip_ipsec.c
@@ -117,10 +117,9 @@ ip_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);
@@ -129,7 +128,6 @@ ip_ipsec_fwd(struct mbuf *m)
IP_FORWARDING, &error);
}
if (sp == NULL) { /* NB: can happen if error */
- splx(s);
/*XXX error stat???*/
DPRINTF(("ip_input: no SP for forwarding\n")); /*XXX*/
return 1;
@@ -140,7 +138,6 @@ ip_ipsec_fwd(struct mbuf *m)
*/
error = ipsec_in_reject(sp, m);
KEY_FREESP(&sp);
- splx(s);
if (error) {
IPSTAT_INC(ips_cantforward);
return 1;
@@ -164,7 +161,7 @@ ip_ipsec_input(struct mbuf *m)
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
@@ -178,7 +175,6 @@ ip_ipsec_input(struct mbuf *m)
* 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);
@@ -198,7 +194,6 @@ ip_ipsec_input(struct mbuf *m)
DPRINTF(("ip_input: no SP, packet discarded\n"));/*XXX*/
return 1;
}
- splx(s);
if (error)
return 1;
}
@@ -267,7 +262,6 @@ ip_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error)
struct ip *ip = mtod(*m, struct ip *);
struct tdb_ident *tdbi;
struct m_tag *mtag;
- int s;
/*
* Check the security policy (SP) for the packet and, if
* required, do IPsec-related processing. There are two
@@ -278,7 +272,6 @@ ip_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error)
* the lookup and related policy checking.
*/
mtag = m_tag_find(*m, PACKET_TAG_IPSEC_PENDING_TDB, NULL);
- s = splnet();
if (mtag != NULL) {
tdbi = (struct tdb_ident *)(mtag + 1);
sp = ipsec_getpolicy(tdbi, IPSEC_DIR_OUTBOUND);
@@ -327,7 +320,6 @@ ip_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error)
* done: below.
*/
KEY_FREESP(&sp), sp = NULL;
- splx(s);
goto done;
}
}
@@ -372,10 +364,8 @@ ip_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error)
*/
if (*error == ENOENT)
*error = 0;
- splx(s);
goto reinjected;
} else { /* sp == NULL */
- splx(s);
if (*error != 0) {
/*
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
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index bda5d41..2d6443d 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -6912,16 +6912,12 @@ key_freereg(struct socket *so)
static int
key_expire(struct secasvar *sav)
{
- int s;
int satype;
struct mbuf *result = NULL, *m;
int len;
int error = -1;
struct sadb_lifetime *lt;
- /* XXX: Why do we lock ? */
- s = splnet(); /*called from softclock()*/
-
IPSEC_ASSERT (sav != NULL, ("null sav"));
IPSEC_ASSERT (sav->sah != NULL, ("null sa header"));
@@ -7023,13 +7019,11 @@ key_expire(struct secasvar *sav)
mtod(result, struct sadb_msg *)->sadb_msg_len =
PFKEY_UNIT64(result->m_pkthdr.len);
- splx(s);
return key_sendup_mbuf(NULL, result, KEY_SENDUP_REGISTERED);
fail:
if (result)
m_freem(result);
- splx(s);
return error;
}
OpenPOWER on IntegriCloud