Permalink
Browse files

drop wrongly looped back multicast packet before put it into BPF.

  • Loading branch information...
1 parent b21ab71 commit f427e1aac8f149b12701fdef8b799beb28fce6a6 itojun committed Sep 12, 1999
Showing with 14 additions and 13 deletions.
  1. +14 −13 netbsd/sys/dev/ic/smc91cxx.c
@@ -923,10 +923,22 @@ smc91cxx_read(sc)
ifp->if_ipackets++;
+ if ((ifp->if_flags & IFF_PROMISC) != 0) {
+ /*
+ * Make sure to behave as IFF_SIMPLEX in all cases.
+ * Drop multicast/broadcast packet looped back from myself
+ * (should be ensured by chipset configuration).
+ */
+ if ((eh->ether_dhost[0] & 1) == 1 && /* mcast || bcast */
+ ether_cmp(eh->ether_shost, LLADDR(ifp->if_sadl)) == 0) {
+ m_freem(m);
+ goto out;
+ }
+ }
+
#if NBPFILTER > 0
/*
- * Hand the packet off to bpf listeners. If there's a bpf listener,
- * we need to check if the packet is ours.
+ * Hand the packet off to bpf listeners.
*/
if (ifp->if_bpf)
bpf_mtap(ifp->if_bpf, m);
@@ -941,17 +953,6 @@ smc91cxx_read(sc)
m_freem(m);
goto out;
}
-
- /*
- * Make sure to behave as IFF_SIMPLEX in all cases.
- * Drop multicast/broadcast packet looped back from myself
- * (should be ensured by chipset configuration).
- */
- if ((eh->ether_dhost[0] & 1) == 1 && /* mcast || bcast */
- ether_cmp(eh->ether_shost, LLADDR(ifp->if_sadl)) == 0) {
- m_freem(m);
- goto out;
- }
}
/*

0 comments on commit f427e1a

Please sign in to comment.