summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net')
-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
6 files changed, 13 insertions, 99 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;
}
OpenPOWER on IntegriCloud