summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>1999-02-28 03:23:39 +0000
committerJason Wright <jason@cvs.openbsd.org>1999-02-28 03:23:39 +0000
commit8b2014f291d209ff3ff452181dde5a2507e25963 (patch)
tree95438b5752ecc8ed381c9a1dfdcf7e343aa0a3a5
parent972131883b729aa5be397346b44e7f6e98a012a0 (diff)
compensate for the test of packet ownership being moved to ether_input()
-rw-r--r--sys/dev/ic/dp8390.c22
-rw-r--r--sys/dev/ic/elink3.c18
-rw-r--r--sys/dev/ic/smc91cxx.c16
-rw-r--r--sys/dev/isa/if_ed.c18
-rw-r--r--sys/dev/isa/if_eg.c18
-rw-r--r--sys/dev/isa/if_el.c18
-rw-r--r--sys/dev/isa/if_ex.c21
-rw-r--r--sys/dev/isa/if_fe.c18
-rw-r--r--sys/dev/isa/if_hp.c10
-rw-r--r--sys/dev/isa/if_iy.c12
10 files changed, 19 insertions, 152 deletions
diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c
index 2df1fea5ad3..49e9d6d9051 100644
--- a/sys/dev/ic/dp8390.c
+++ b/sys/dev/ic/dp8390.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dp8390.c,v 1.1 1998/09/22 06:41:12 fgsch Exp $ */
+/* $OpenBSD: dp8390.c,v 1.2 1999/02/28 03:23:36 jason Exp $ */
/* $NetBSD: dp8390.c,v 1.13 1998/07/05 06:49:11 jonathan Exp $ */
/*
@@ -1000,26 +1000,8 @@ dp8390_read(sc, buf, len)
* Check if there's a BPF listener on this interface.
* If so, hand off the raw packet to bpf.
*/
- if (ifp->if_bpf) {
+ if (ifp->if_bpf)
bpf_mtap(ifp->if_bpf, m);
-
- /*
- * Note that the interface cannot be in promiscuous mode if
- * there are no BPF listeners. And if we are in promiscuous
- * mode, we have to check if this packet is really ours.
- */
- if ((ifp->if_flags & IFF_PROMISC) &&
- (eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
-#ifdef __NetBSD__
- bcmp(eh->ether_dhost, LLADDR(ifp->if_sadl),
-#else
- bcmp(eh->ether_dhost, sc->sc_arpcom.ac_enaddr,
-#endif
- sizeof(eh->ether_dhost)) != 0) {
- m_freem(m);
- return;
- }
- }
#endif
/* Fix up data start offset in mbuf to point past ether header. */
diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c
index 247bd81b98c..c8b52d4bf67 100644
--- a/sys/dev/ic/elink3.c
+++ b/sys/dev/ic/elink3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: elink3.c,v 1.30 1998/12/26 23:58:33 niklas Exp $ */
+/* $OpenBSD: elink3.c,v 1.31 1999/02/28 03:23:36 jason Exp $ */
/* $NetBSD: elink3.c,v 1.32 1997/05/14 00:22:00 thorpej Exp $ */
/*
@@ -1163,22 +1163,8 @@ again:
* Check if there's a BPF listener on this interface.
* If so, hand off the raw packet to BPF.
*/
- if (ifp->if_bpf) {
+ if (ifp->if_bpf)
bpf_mtap(ifp->if_bpf, m);
-
- /*
- * Note that the interface cannot be in promiscuous mode if
- * there are no BPF listeners. And if we are in promiscuous
- * mode, we have to check if this packet is really ours.
- */
- if ((ifp->if_flags & IFF_PROMISC) &&
- (eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
- bcmp(eh->ether_dhost, sc->sc_arpcom.ac_enaddr,
- sizeof(eh->ether_dhost)) != 0) {
- m_freem(m);
- return;
- }
- }
#endif
/* We assume the header fit entirely in one mbuf. */
diff --git a/sys/dev/ic/smc91cxx.c b/sys/dev/ic/smc91cxx.c
index a423c51c9e9..8878c3b4055 100644
--- a/sys/dev/ic/smc91cxx.c
+++ b/sys/dev/ic/smc91cxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smc91cxx.c,v 1.2 1998/09/12 07:48:07 fgsch Exp $ */
+/* $OpenBSD: smc91cxx.c,v 1.3 1999/02/28 03:23:37 jason Exp $ */
/* $NetBSD: smc91cxx.c,v 1.11 1998/08/08 23:51:41 mycroft Exp $ */
/*-
@@ -991,20 +991,8 @@ smc91cxx_read(sc)
* Hand the packet off to bpf listeners. If there's a bpf listener,
* we need to check if the packet is ours.
*/
- if (ifp->if_bpf) {
+ if (ifp->if_bpf)
bpf_mtap(ifp->if_bpf, m);
-
- if ((ifp->if_flags & IFF_PROMISC) &&
- (eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
-#ifdef __NetBSD__
- ether_cmp(eh->ether_dhost, LLADDR(ifp->if_sadl))) {
-#else
- ether_cmp(eh->ether_dhost, sc->sc_arpcom.ac_enaddr)) {
-#endif
- m_freem(m);
- goto out;
- }
- }
#endif
/*
diff --git a/sys/dev/isa/if_ed.c b/sys/dev/isa/if_ed.c
index effdbdaa413..701f4296ee1 100644
--- a/sys/dev/isa/if_ed.c
+++ b/sys/dev/isa/if_ed.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ed.c,v 1.40 1998/08/11 03:28:37 millert Exp $ */
+/* $OpenBSD: if_ed.c,v 1.41 1999/02/28 03:23:37 jason Exp $ */
/* $NetBSD: if_ed.c,v 1.105 1996/10/21 22:40:45 thorpej Exp $ */
/*
@@ -2562,22 +2562,8 @@ edread(sc, buf, len)
* Check if there's a BPF listener on this interface.
* If so, hand off the raw packet to BPF.
*/
- if (ifp->if_bpf) {
+ if (ifp->if_bpf)
bpf_mtap(ifp->if_bpf, m);
-
- /*
- * Note that the interface cannot be in promiscuous mode if
- * there are no BPF listeners. And if we are in promiscuous
- * mode, we have to check if this packet is really ours.
- */
- if ((ifp->if_flags & IFF_PROMISC) &&
- (eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
- bcmp(eh->ether_dhost, sc->sc_arpcom.ac_enaddr,
- sizeof(eh->ether_dhost)) != 0) {
- m_freem(m);
- return;
- }
- }
#endif
/* We assume that the header fit entirely in one mbuf. */
diff --git a/sys/dev/isa/if_eg.c b/sys/dev/isa/if_eg.c
index dd28594204d..058b81cda31 100644
--- a/sys/dev/isa/if_eg.c
+++ b/sys/dev/isa/if_eg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_eg.c,v 1.13 1997/11/07 08:06:47 niklas Exp $ */
+/* $OpenBSD: if_eg.c,v 1.14 1999/02/28 03:23:37 jason Exp $ */
/* $NetBSD: if_eg.c,v 1.26 1996/05/12 23:52:27 mycroft Exp $ */
/*
@@ -665,22 +665,8 @@ egread(sc, buf, len)
* Check if there's a BPF listener on this interface.
* If so, hand off the raw packet to BPF.
*/
- if (ifp->if_bpf) {
+ if (ifp->if_bpf)
bpf_mtap(ifp->if_bpf, m);
-
- /*
- * Note that the interface cannot be in promiscuous mode if
- * there are no BPF listeners. And if we are in promiscuous
- * mode, we have to check if this packet is really ours.
- */
- if ((ifp->if_flags & IFF_PROMISC) &&
- (eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
- bcmp(eh->ether_dhost, sc->sc_arpcom.ac_enaddr,
- sizeof(eh->ether_dhost)) != 0) {
- m_freem(m);
- return;
- }
- }
#endif
/* We assume the header fit entirely in one mbuf. */
diff --git a/sys/dev/isa/if_el.c b/sys/dev/isa/if_el.c
index 7036ec9dbcb..fa80836748c 100644
--- a/sys/dev/isa/if_el.c
+++ b/sys/dev/isa/if_el.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_el.c,v 1.11 1996/05/26 00:27:18 deraadt Exp $ */
+/* $OpenBSD: if_el.c,v 1.12 1999/02/28 03:23:37 jason Exp $ */
/* $NetBSD: if_el.c,v 1.39 1996/05/12 23:52:32 mycroft Exp $ */
/*
@@ -530,22 +530,8 @@ elread(sc, len)
* Check if there's a BPF listener on this interface.
* If so, hand off the raw packet to BPF.
*/
- if (ifp->if_bpf) {
+ if (ifp->if_bpf)
bpf_mtap(ifp->if_bpf, m);
-
- /*
- * Note that the interface cannot be in promiscuous mode if
- * there are no BPF listeners. And if we are in promiscuous
- * mode, we have to check if this packet is really ours.
- */
- if ((ifp->if_flags & IFF_PROMISC) &&
- (eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
- bcmp(eh->ether_dhost, sc->sc_arpcom.ac_enaddr,
- sizeof(eh->ether_dhost)) != 0) {
- m_freem(m);
- return;
- }
- }
#endif
/* We assume that the header fit entirely in one mbuf. */
diff --git a/sys/dev/isa/if_ex.c b/sys/dev/isa/if_ex.c
index ff1b73fefdc..963b0ac2657 100644
--- a/sys/dev/isa/if_ex.c
+++ b/sys/dev/isa/if_ex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ex.c,v 1.3 1999/02/13 01:02:21 fgsch Exp $ */
+/* $OpenBSD: if_ex.c,v 1.4 1999/02/28 03:23:38 jason Exp $ */
/*
* Copyright (c) 1997, Donald A. Schmidt
* Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es)
@@ -769,25 +769,8 @@ ex_rx_intr(sc)
}
#endif
#if NBPFILTER > 0
- if (ifp->if_bpf != NULL) {
+ if (ifp->if_bpf != NULL)
bpf_mtap(ifp->if_bpf, ipkt);
- /*
- * Note that the interface cannot be in
- * promiscuous mode if there are no BPF
- * listeners. And if we are in promiscuous
- * mode, we have to check if this packet is
- * really ours.
- */
- if ((ifp->if_flags & IFF_PROMISC) &&
- (eh->ether_dhost[0] & 1) == 0 &&
- bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- sizeof(eh->ether_dhost)) != 0 &&
- bcmp(eh->ether_dhost, etherbroadcastaddr,
- sizeof(eh->ether_dhost)) != 0) {
- m_freem(ipkt);
- goto rx_another;
- }
- }
#endif
m_adj(ipkt, sizeof(struct ether_header));
ether_input(ifp, eh, ipkt);
diff --git a/sys/dev/isa/if_fe.c b/sys/dev/isa/if_fe.c
index 7ed9f0194a5..277607a02f4 100644
--- a/sys/dev/isa/if_fe.c
+++ b/sys/dev/isa/if_fe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_fe.c,v 1.11 1997/11/07 08:06:53 niklas Exp $ */
+/* $OpenBSD: if_fe.c,v 1.12 1999/02/28 03:23:38 jason Exp $ */
/*
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
@@ -2077,22 +2077,8 @@ fe_get_packet(sc, len)
* Check if there's a BPF listener on this interface. If so, hand off
* the raw packet to bpf.
*/
- if (ifp->if_bpf) {
+ if (ifp->if_bpf)
bpf_mtap(ifp->if_bpf, m);
-
- /*
- * Note that the interface cannot be in promiscuous mode if
- * there are no BPF listeners. And if we are in promiscuous
- * mode, we have to check if this packet is really ours.
- */
- if ((ifp->if_flags & IFF_PROMISC) != 0 &&
- (eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
- bcmp(eh->ether_dhost, sc->sc_arpcom.ac_enaddr,
- sizeof(eh->ether_dhost)) != 0) {
- m_freem(m);
- return (1);
- }
- }
#endif
/* Fix up data start offset in mbuf to point past ether header. */
diff --git a/sys/dev/isa/if_hp.c b/sys/dev/isa/if_hp.c
index c4e48e29cf2..f231063509d 100644
--- a/sys/dev/isa/if_hp.c
+++ b/sys/dev/isa/if_hp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_hp.c,v 1.4 1996/05/05 13:38:41 mickey Exp $ */
+/* $OpenBSD: if_hp.c,v 1.5 1999/02/28 03:23:38 jason Exp $ */
/* $NetBSD: if_hp.c,v 1.21 1995/12/24 02:31:31 mycroft Exp $ */
/* XXX THIS DRIVER IS BROKEN. IT WILL NOT EVEN COMPILE. */
@@ -812,14 +812,6 @@ hpread(ns, buf, len)
if (ns->ns_bpf)
bpf_tap(ns->ns_bpf, buf, len + sizeof(struct ether_header));
#endif
-
- if ((ns->ns_if.if_flags & IFF_PROMISC)
- && bcmp(eh->ether_dhost, ns->ns_addrp,
- sizeof(eh->ether_dhost)) != 0
- && bcmp(eh->ether_dhost, etherbroadcastaddr,
- sizeof(eh->ether_dhost)) != 0)
- return;
-
/*
* Pull packet off interface. Off is nonzero if packet
* has trailing header; hpget will then force this header
diff --git a/sys/dev/isa/if_iy.c b/sys/dev/isa/if_iy.c
index 363ddbefbab..76242a5f4d8 100644
--- a/sys/dev/isa/if_iy.c
+++ b/sys/dev/isa/if_iy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iy.c,v 1.3 1997/11/07 08:07:00 niklas Exp $ */
+/* $OpenBSD: if_iy.c,v 1.4 1999/02/28 03:23:38 jason Exp $ */
/* $NetBSD: if_iy.c,v 1.4 1996/05/12 23:52:53 mycroft Exp $ */
/* #define IYDEBUG */
/* #define IYMEMDEBUG */
@@ -847,16 +847,8 @@ int iobase, rxlen;
eh = mtod(top, struct ether_header *);
#if NBPFILTER > 0
- if (ifp->if_bpf) {
+ if (ifp->if_bpf)
bpf_mtap(ifp->if_bpf, top);
- if ((ifp->if_flags & IFF_PROMISC) &&
- (eh->ether_dhost[0] & 1) == 0 &&
- bcmp(eh->ether_dhost, sc->sc_arpcom.ac_enaddr,
- sizeof(eh->ether_dhost)) != 0) {
- m_freem(top);
- return;
- }
- }
#endif
m_adj(top, sizeof(struct ether_header));
ether_input(ifp, eh, top);