summaryrefslogtreecommitdiff
path: root/sys/dev/ic/rtw.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2013-11-26 09:50:34 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2013-11-26 09:50:34 +0000
commit3b2e59a86d7cdbb14446277252ac4029ad50a025 (patch)
treef0ecf9018ecc9c09e51420fbaea423b178e1ad3c /sys/dev/ic/rtw.c
parentc9ed8e3acafb6f8b5270d893558be103887617d7 (diff)
Instead of comparing the lower and higher addresses of all the multicast
entries to decide if the IFF_ALLMULTI flag should be set, check if there is at least one real range between them. This should not change the behavior of any driver but if you encounter any problem, feel free to revert the offending chunk and ping me about it. ok naddy@, dlg@
Diffstat (limited to 'sys/dev/ic/rtw.c')
-rw-r--r--sys/dev/ic/rtw.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/dev/ic/rtw.c b/sys/dev/ic/rtw.c
index f79999753b8..02622421ac3 100644
--- a/sys/dev/ic/rtw.c
+++ b/sys/dev/ic/rtw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtw.c,v 1.82 2012/12/05 23:20:19 deraadt Exp $ */
+/* $OpenBSD: rtw.c,v 1.83 2013/11/26 09:50:33 mpi Exp $ */
/* $NetBSD: rtw.c,v 1.29 2004/12/27 19:49:16 dyoung Exp $ */
/*-
@@ -2278,7 +2278,7 @@ rtw_pktfilt_load(struct rtw_softc *sc)
{
struct rtw_regs *regs = &sc->sc_regs;
struct ieee80211com *ic = &sc->sc_ic;
- struct arpcom *ec = &ic->ic_ac;
+ struct arpcom *ac = &ic->ic_ac;
struct ifnet *ifp = &sc->sc_ic.ic_if;
int hash;
u_int32_t hashes[2] = { 0, 0 };
@@ -2317,8 +2317,9 @@ rtw_pktfilt_load(struct rtw_softc *sc)
if ((ifp->if_flags & IFF_BROADCAST) != 0)
sc->sc_rcr |= RTW_RCR_AB; /* accept all broadcast */
- if (ifp->if_flags & IFF_PROMISC) {
- sc->sc_rcr |= RTW_RCR_AB; /* accept all broadcast */
+ if (ifp->if_flags & IFF_PROMISC || ac->ac_multirangecnt > 0) {
+ if (ifp->if_flags & IFF_PROMISC)
+ sc->sc_rcr |= RTW_RCR_AB; /* accept all broadcast */
allmulti:
ifp->if_flags |= IFF_ALLMULTI;
goto setit;
@@ -2327,13 +2328,8 @@ allmulti:
/*
* Program the 64-bit multicast hash filter.
*/
- ETHER_FIRST_MULTI(step, ec, enm);
+ ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- /* XXX */
- if (bcmp(enm->enm_addrlo, enm->enm_addrhi,
- ETHER_ADDR_LEN) != 0)
- goto allmulti;
-
hash = ether_crc32_be((enm->enm_addrlo),
IEEE80211_ADDR_LEN) >> 26;
hashes[hash >> 5] |= (1 << (hash & 0x1f));