summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2015-07-20 22:54:29 +0000
committermpi <mpi@openbsd.org>2015-07-20 22:54:29 +0000
commitc35d6329d1b25112035a26038f662bd9cd376ac5 (patch)
tree0198b8b13966ecdba32ea707d2e000d4944027a1
parentproperly encode IpAddress, Gauge32, and Counter32 (diff)
downloadwireguard-openbsd-c35d6329d1b25112035a26038f662bd9cd376ac5.tar.xz
wireguard-openbsd-c35d6329d1b25112035a26038f662bd9cd376ac5.zip
Remove splassert(IPL_NET) from if_input().
if_input() has been designed to be able to safely handle a batch of packets from physical drivers to the network stack. Most of these drivers have an interrupt routine executed at IPL_NET and the check made sense during the conversion. However we also want to re-enqueue packets with if_input() from the network stack currently running at IPL_SOFTNET. ok claudio@
-rw-r--r--sys/net/if.c4
-rw-r--r--sys/net/if_bridge.c5
-rw-r--r--sys/net/if_loop.c6
-rw-r--r--sys/net/if_tun.c5
-rw-r--r--sys/net/if_vxlan.c5
5 files changed, 5 insertions, 20 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 03f1a5ee259..f152729e417 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.353 2015/07/20 21:16:39 rzalamena Exp $ */
+/* $OpenBSD: if.c,v 1.354 2015/07/20 22:54:29 mpi Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -472,8 +472,6 @@ if_input(struct ifnet *ifp, struct mbuf_list *ml)
struct mbuf *m;
size_t ibytes = 0;
- splassert(IPL_NET);
-
MBUF_LIST_FOREACH(ml, m) {
m->m_pkthdr.ph_ifidx = ifp->if_index;
m->m_pkthdr.ph_rtableid = ifp->if_rdomain;
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 094aadb609a..00f75df92de 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.256 2015/07/20 22:16:41 rzalamena Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.257 2015/07/20 22:54:29 mpi Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -1549,7 +1549,6 @@ bridge_localbroadcast(struct bridge_softc *sc, struct ifnet *ifp,
struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m1;
u_int16_t etype;
- int s;
/*
* quick optimisation, don't send packets up the stack if no
@@ -1573,9 +1572,7 @@ bridge_localbroadcast(struct bridge_softc *sc, struct ifnet *ifp,
}
m1->m_flags |= M_PROTO1;
ml_enqueue(&ml, m1);
- s = splnet();
if_input(ifp, &ml);
- splx(s);
}
void
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index cda152065ad..bbfa847e828 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_loop.c,v 1.67 2015/07/20 21:16:39 rzalamena Exp $ */
+/* $OpenBSD: if_loop.c,v 1.68 2015/07/20 22:54:29 mpi Exp $ */
/* $NetBSD: if_loop.c,v 1.15 1996/05/07 02:40:33 thorpej Exp $ */
/*
@@ -205,7 +205,6 @@ looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
{
struct niqueue *ifq = NULL;
struct mbuf_list ml = MBUF_LIST_INITIALIZER();
- int s;
if ((m->m_flags & M_PKTHDR) == 0)
panic("looutput: no header mbuf");
@@ -246,10 +245,7 @@ looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
}
ml_enqueue(&ml, m);
-
- s = splnet();
if_input(ifp, &ml);
- splx(s);
return (0);
#endif /* MPLS */
default:
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index a8d25da4983..8c81ce3680f 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tun.c,v 1.150 2015/07/15 22:16:42 deraadt Exp $ */
+/* $OpenBSD: if_tun.c,v 1.151 2015/07/20 22:54:29 mpi Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
@@ -875,10 +875,7 @@ tunwrite(dev_t dev, struct uio *uio, int ioflag)
struct mbuf_list ml = MBUF_LIST_INITIALIZER();
ml_enqueue(&ml, top);
- s = splnet();
if_input(ifp, &ml);
- splx(s);
-
return (0);
}
diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c
index c0ac347e2bb..bb263c70982 100644
--- a/sys/net/if_vxlan.c
+++ b/sys/net/if_vxlan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vxlan.c,v 1.26 2015/07/18 22:15:14 goda Exp $ */
+/* $OpenBSD: if_vxlan.c,v 1.27 2015/07/20 22:54:30 mpi Exp $ */
/*
* Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org>
@@ -478,7 +478,6 @@ vxlan_lookup(struct mbuf *m, struct udphdr *uh, int iphlen,
#if NBRIDGE > 0
struct sockaddr *sa;
#endif
- int s;
/* XXX Should verify the UDP port first before copying the packet */
skip = iphlen + sizeof(*uh);
@@ -531,9 +530,7 @@ vxlan_lookup(struct mbuf *m, struct udphdr *uh, int iphlen,
#endif
ml_enqueue(&ml, m);
- s = splnet();
if_input(ifp, &ml);
- splx(s);
/* success */
return (1);