summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-04-17 13:39:49 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-04-17 13:39:49 +0000
commitb3f0d0e2917dea248672081f3e146a11b77d04d4 (patch)
treeac7f986e05d57509087fbd0d924fb36b082c3aa7 /sys/arch/mvme88k
parent21e807539ec0f1fbe79a418aa610f7f6787e171b (diff)
Revert previous - causes misaligned exceptions in ip4_input()...
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r--sys/arch/mvme88k/dev/if_ie.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/sys/arch/mvme88k/dev/if_ie.c b/sys/arch/mvme88k/dev/if_ie.c
index 8d305d75a1b..05690af57ee 100644
--- a/sys/arch/mvme88k/dev/if_ie.c
+++ b/sys/arch/mvme88k/dev/if_ie.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ie.c,v 1.39 2006/04/16 00:46:32 pascoe Exp $ */
+/* $OpenBSD: if_ie.c,v 1.40 2006/04/17 13:39:48 miod Exp $ */
/*-
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -940,7 +940,7 @@ ieget(sc, mp, ehp, to_bpf)
{
struct mbuf *m, *top, **mymp;
int i;
- int offset = 0;
+ int offset;
int totlen, resid;
int thismboff;
int head;
@@ -968,6 +968,7 @@ ieget(sc, mp, ehp, to_bpf)
sc->sc_arpcom.ac_if.if_ierrors--; /* just this case, it's not an error */
return -1;
}
+ totlen -= (offset = sizeof *ehp);
MGETHDR(*mp, M_DONTWAIT, MT_DATA);
if (!*mp) {
@@ -1154,10 +1155,19 @@ ie_readframe(sc, num)
}
#if NBPFILTER > 0
- /* Check for a BPF filter; if so, hand it up. */
- if (bpf_gets_it)
- bpf_mtap(sc->sc_arpcom.ac_if.if_bpf, m, BPF_DIRECTION_IN);
-
+ /*
+ * Check for a BPF filter; if so, hand it up.
+ * Note that we have to stick an extra mbuf up front, because bpf_mtap
+ * expects to have the ether header at the front.
+ * It doesn't matter that this results in an ill-formatted mbuf chain,
+ * since BPF just looks at the data. (It doesn't try to free the mbuf,
+ * tho' it will make a copy for tcpdump.)
+ */
+ if (bpf_gets_it) {
+ /* Pass it up. */
+ bpf_mtap_hdr(sc->sc_arpcom.ac_if.if_bpf, (caddr_t)&eh,
+ sizeof(eh), m, BPF_DIRECTION_IN);
+ }
/*
* A signal passed up from the filtering code indicating that the
* packet is intended for BPF but not for the protocol machinery.
@@ -1180,7 +1190,7 @@ ie_readframe(sc, num)
/*
* Finally pass this packet up to higher layers.
*/
- ether_input_mbuf(&sc->sc_arpcom.ac_if, m);
+ ether_input(&sc->sc_arpcom.ac_if, &eh, m);
}
void