make sure that packets are ours before passing them up if interface is

in promiscuous mode; from Juergen Weiss in PR kern/3121.
This commit is contained in:
mikel 1997-02-20 06:59:32 +00:00
parent a92b2e06e5
commit b6a5671c00
1 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pdq_ifsubr.c,v 1.5 1996/05/20 00:26:21 thorpej Exp $ */
/* $NetBSD: pdq_ifsubr.c,v 1.6 1997/02/20 06:59:32 mikel Exp $ */
/*-
* Copyright (c) 1995, 1996 Matt Thomas <matt@3am-software.com>
@ -201,7 +201,11 @@ pdq_os_receive_pdu(
#if NBPFILTER > 0
if (sc->sc_bpf != NULL)
PDQ_BPF_MTAP(sc, m);
if ((fh->fddi_fc & (FDDIFC_L|FDDIFC_F)) != FDDIFC_LLC_ASYNC) {
if ((fh->fddi_fc & (FDDIFC_L|FDDIFC_F)) != FDDIFC_LLC_ASYNC ||
(sc->sc_if.if_flags & IFF_PROMISC) &&
(fh->fddi_dhost[0] & 1) == 0 && /* !mcast and !bcast */
bcmp(fh->fddi_dhost, sc->sc_ac.ac_enaddr,
sizeof(fh->fddi_dhost)) != 0) {
m_freem(m);
return;
}