diff options
author | 2009-08-09 03:03:19 +0000 | |
---|---|---|
committer | 2009-08-09 03:03:19 +0000 | |
commit | ee9595e03d40579715acc33dc3f93789714d4ca5 (patch) | |
tree | 01bcdeaa321bb953bc7a1df07be8b20726cbcf2a /sys | |
parent | - simplify a bit queue_message_update() (diff) | |
download | wireguard-openbsd-ee9595e03d40579715acc33dc3f93789714d4ca5.tar.xz wireguard-openbsd-ee9595e03d40579715acc33dc3f93789714d4ca5.zip |
Rewrite bits of the multicast handling code as it should be.
The handling of the IFF_ALLMULTI flag is wrong and the bcmp based range
checking shouldn't be there.
From Brad
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_ale.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/dev/pci/if_ale.c b/sys/dev/pci/if_ale.c index 3be1ab8be27..e0f1b11d308 100644 --- a/sys/dev/pci/if_ale.c +++ b/sys/dev/pci/if_ale.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ale.c,v 1.7 2009/08/05 03:19:48 kevlo Exp $ */ +/* $OpenBSD: if_ale.c,v 1.8 2009/08/09 03:03:19 kevlo Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org> * All rights reserved. @@ -2030,15 +2030,15 @@ ale_rxfilter(struct ale_softc *sc) rxcfg = CSR_READ_4(sc, ALE_MAC_CFG); rxcfg &= ~(MAC_CFG_ALLMULTI | MAC_CFG_BCAST | MAC_CFG_PROMISC); + ifp->if_flags &= ~IFF_ALLMULTI; /* * Always accept broadcast frames. */ rxcfg |= MAC_CFG_BCAST; - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC || - ac->ac_multirangecnt > 0) { -allmulti: + if (ifp->if_flags & IFF_PROMISC || ac->ac_multirangecnt > 0) { + ifp->if_flags |= IFF_ALLMULTI; if (ifp->if_flags & IFF_PROMISC) rxcfg |= MAC_CFG_PROMISC; else @@ -2050,14 +2050,10 @@ 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; - } crc = ether_crc32_le(enm->enm_addrlo, ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); + ETHER_NEXT_MULTI(step, enm); } } |