summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-18 02:11:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-18 02:11:54 +0000
commitb66e5c4431a1e293f203c0f530a6aa3bd62264c9 (patch)
tree4b64f2d84b2208bc5652cd70573b01fcfb7105a5 /sys
parentde8a4d2ae31202ea3ddf855adfaca582a71220a8 (diff)
improve the bpf path. packets we send out via the bridge are seen, but
those that come in the bridge are still invisible. the bridge is going to have to bpf those for us.
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_vether.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/net/if_vether.c b/sys/net/if_vether.c
index 7e5d3b14819..366db72bdfa 100644
--- a/sys/net/if_vether.c
+++ b/sys/net/if_vether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vether.c,v 1.4 2009/11/18 02:10:45 deraadt Exp $ */
+/* $OpenBSD: if_vether.c,v 1.5 2009/11/18 02:11:53 deraadt Exp $ */
/*
* Copyright (c) 2009 Theo de Raadt
@@ -15,7 +15,9 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+
#include "vether.h"
+#include "bpfilter.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -42,7 +44,6 @@
#include <dev/rndvar.h>
-#include "bpfilter.h"
#if NBPFILTER > 0
#include <net/bpf.h>
#endif
@@ -178,15 +179,18 @@ vetherstart(struct ifnet *ifp)
BPF_DIRECTION_IN : BPF_DIRECTION_OUT;
m->m_flags &= ~M_PROTO1;
+ if (inout == BPF_DIRECTION_IN) {
#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap_ether(ifp->if_bpf, m, inout);
+ if (ifp->if_bpf)
+ bpf_mtap(ifp->if_bpf, m, inout);
#endif
-
- if (inout == BPF_DIRECTION_IN) {
ether_input_mbuf(ifp, m);
ifp->if_ipackets++;
} else {
+#if NBPFILTER > 0
+ if (ifp->if_bpf)
+ bpf_mtap_ether(ifp->if_bpf, m, inout);
+#endif
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
m_freem(m);