From f8141f6f97ad9776c147468465f8c6507897ae3d Mon Sep 17 00:00:00 2001 From: David Greenman Date: Mon, 22 May 1995 05:51:41 +0000 Subject: [PATCH] Fixed bug in bpf/multicast support that caused multicast packets to get thrown out if bpfilter support and no BPF listener. (submitted by Bill Fenner) Removed unused variable and changed another from a stack variable to a static - the variable was a rather large array of structs that consumed a lot of stack space. (me) --- sys/dev/de/if_de.c | 12 +++++------- sys/pci/if_de.c | 12 +++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index 0c84b6514bde..b2d72c197256 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_de.c,v 1.12 1995/05/05 19:44:06 thomas Exp $ + * $Id: if_de.c,v 1.24 1995/05/05 20:09:51 davidg Exp $ * */ @@ -638,12 +638,10 @@ tulip_rx_intr( #if NBPFILTER > 0 if (sc->tulip_bpf != NULL) { bpf_tap(sc->tulip_bpf, mtod(m, caddr_t), total_len); - if ((eh.ether_dhost[0] & 1) == 0 && + if (sc->tulip_if.if_flags & IFF_PROMISC && + (eh.ether_dhost[0] & 1) == 0 && !TULIP_ADDREQUAL(eh.ether_dhost, sc->tulip_ac.ac_enaddr)) goto next; - } else if (!TULIP_ADDREQUAL(eh.ether_dhost, sc->tulip_ac.ac_enaddr) - && !TULIP_ADDRBRDCST(eh.ether_dhost)) { - goto next; } #endif accept = 1; @@ -801,7 +799,8 @@ tulip_start( tulip_ringinfo_t *ri = &sc->tulip_txinfo; tulip_desc_t *sop, *eop; struct mbuf *m; - tulip_addrvec_t addrvec[TULIP_MAX_TXSEG+1], *avp; + static tulip_addrvec_t addrvec[TULIP_MAX_TXSEG+1]; + tulip_addrvec_t *avp; int segcnt; tulip_uint32_t d_status; @@ -1009,7 +1008,6 @@ tulip_read_srom( const unsigned cmdmask = (SROMCMD_RD << bitwidth); const unsigned msb = 1 << (bitwidth + 3 - 1); unsigned lastidx = (1 << bitwidth) - 1; - int lowbit = 0; tulip_idle_srom(sc); diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c index 0c84b6514bde..b2d72c197256 100644 --- a/sys/pci/if_de.c +++ b/sys/pci/if_de.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_de.c,v 1.12 1995/05/05 19:44:06 thomas Exp $ + * $Id: if_de.c,v 1.24 1995/05/05 20:09:51 davidg Exp $ * */ @@ -638,12 +638,10 @@ tulip_rx_intr( #if NBPFILTER > 0 if (sc->tulip_bpf != NULL) { bpf_tap(sc->tulip_bpf, mtod(m, caddr_t), total_len); - if ((eh.ether_dhost[0] & 1) == 0 && + if (sc->tulip_if.if_flags & IFF_PROMISC && + (eh.ether_dhost[0] & 1) == 0 && !TULIP_ADDREQUAL(eh.ether_dhost, sc->tulip_ac.ac_enaddr)) goto next; - } else if (!TULIP_ADDREQUAL(eh.ether_dhost, sc->tulip_ac.ac_enaddr) - && !TULIP_ADDRBRDCST(eh.ether_dhost)) { - goto next; } #endif accept = 1; @@ -801,7 +799,8 @@ tulip_start( tulip_ringinfo_t *ri = &sc->tulip_txinfo; tulip_desc_t *sop, *eop; struct mbuf *m; - tulip_addrvec_t addrvec[TULIP_MAX_TXSEG+1], *avp; + static tulip_addrvec_t addrvec[TULIP_MAX_TXSEG+1]; + tulip_addrvec_t *avp; int segcnt; tulip_uint32_t d_status; @@ -1009,7 +1008,6 @@ tulip_read_srom( const unsigned cmdmask = (SROMCMD_RD << bitwidth); const unsigned msb = 1 << (bitwidth + 3 - 1); unsigned lastidx = (1 << bitwidth) - 1; - int lowbit = 0; tulip_idle_srom(sc);