summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed/if_ed.c
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2001-02-08 22:54:57 +0000
committerluigi <luigi@FreeBSD.org>2001-02-08 22:54:57 +0000
commit38a15079cdaa8e4c8afb6e2d946e1d02a9b4de39 (patch)
treef57d09aaa30a2af750b792b8e25db8e23176616e /sys/dev/ed/if_ed.c
parentf13568e414d095f23cc227e8dbc79e9cc486a1bf (diff)
downloadFreeBSD-src-38a15079cdaa8e4c8afb6e2d946e1d02a9b4de39.zip
FreeBSD-src-38a15079cdaa8e4c8afb6e2d946e1d02a9b4de39.tar.gz
Whoops... forgotten a few pieces in previous patch:
* a ">" is really ">=" ; * do not try to fetch zero-sized blocks from the card; * make sure that bpf gets the packets it wants even with bridging active;
Diffstat (limited to 'sys/dev/ed/if_ed.c')
-rw-r--r--sys/dev/ed/if_ed.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index 1d877cb..604c287 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -2177,7 +2177,7 @@ ed_rint(sc)
* But make sure that we have at least a full ethernet header
* or we would be unable to call ether_input() later.
*/
- if ((len > sizeof(struct ed_ring) + ETHER_HDR_LEN) &&
+ if ((len >= sizeof(struct ed_ring) + ETHER_HDR_LEN) &&
(len <= MCLBYTES) &&
(packet_hdr.next_packet >= sc->rec_page_start) &&
(packet_hdr.next_packet < sc->rec_page_stop)) {
@@ -2644,17 +2644,21 @@ ed_get_packet(sc, buf, len)
#ifdef BRIDGE
/*
* Don't read in the entire packet if we know we're going to drop it
+ * and no bpf is active.
*/
- if (do_bridge) {
+ if (!sc->arpcom.ac_if.if_bpf &&
+ do_bridge && BDG_USED( (&sc->arpcom.ac_if) ) ) {
struct ifnet *bif;
ed_ring_copy(sc, buf, (char *)eh, ETHER_HDR_LEN);
- if ((bif = bridge_in(&sc->arpcom.ac_if, eh)) == BDG_DROP) {
+ bif = bridge_in(&sc->arpcom.ac_if, eh) ;
+ if (bif == BDG_DROP) {
m_freem(m);
return;
}
- ed_ring_copy(sc, buf + ETHER_HDR_LEN,
- (char *)eh + ETHER_HDR_LEN, len - ETHER_HDR_LEN);
+ if (len > ETHER_HDR_LEN)
+ ed_ring_copy(sc, buf + ETHER_HDR_LEN,
+ (char *)(eh + 1), len - ETHER_HDR_LEN);
} else
#endif
/*
OpenPOWER on IntegriCloud