summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_nge.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/pci/if_nge.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/pci/if_nge.c')
-rw-r--r--sys/dev/pci/if_nge.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c
index c56ebee42c5..d61109555e4 100644
--- a/sys/dev/pci/if_nge.c
+++ b/sys/dev/pci/if_nge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nge.c,v 1.77 2013/11/18 19:43:00 brad Exp $ */
+/* $OpenBSD: if_nge.c,v 1.78 2013/11/26 09:50:33 mpi Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
@@ -586,7 +586,9 @@ nge_setmulti(struct nge_softc *sc)
u_int32_t h = 0, i, filtsave;
int bit, index;
-allmulti:
+ if (ac->ac_multirangecnt > 0)
+ ifp->if_flags |= IFF_ALLMULTI;
+
if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
NGE_CLRBIT(sc, NGE_RXFILT_CTL,
NGE_RXFILTCTL_MCHASH|NGE_RXFILTCTL_UCHASH);
@@ -620,10 +622,6 @@ allmulti:
*/
ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- if (bcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
- ifp->if_flags |= IFF_ALLMULTI;
- goto allmulti;
- }
h = (ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN) >> 21) &
0x00000FFF;
index = (h >> 4) & 0x7F;