diff options
author | 2013-10-23 10:31:19 +0000 | |
---|---|---|
committer | 2013-10-23 10:31:19 +0000 | |
commit | ef787866f61d613a87d50517686ee5f9fdd36e7d (patch) | |
tree | 9e0a4e38ea6bd27f97bd0fc5c220726067fe0757 | |
parent | Checkpoint of work-in-progress DMA support for oaic(4). Not working yet, (diff) | |
download | wireguard-openbsd-ef787866f61d613a87d50517686ee5f9fdd36e7d.tar.xz wireguard-openbsd-ef787866f61d613a87d50517686ee5f9fdd36e7d.zip |
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 introduce any behavior change but will help changing our
representation of multicast enries.
-rw-r--r-- | sys/arch/macppc/dev/if_bm.c | 22 | ||||
-rw-r--r-- | sys/arch/macppc/dev/if_mc.c | 17 |
2 files changed, 10 insertions, 29 deletions
diff --git a/sys/arch/macppc/dev/if_bm.c b/sys/arch/macppc/dev/if_bm.c index cf78b01ff81..f64df84891e 100644 --- a/sys/arch/macppc/dev/if_bm.c +++ b/sys/arch/macppc/dev/if_bm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bm.c,v 1.27 2009/08/25 20:39:36 miod Exp $ */ +/* $OpenBSD: if_bm.c,v 1.28 2013/10/23 10:31:19 mpi Exp $ */ /* $NetBSD: if_bm.c,v 1.1 1999/01/01 01:27:52 tsubai Exp $ */ /*- @@ -847,6 +847,7 @@ bmac_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) void bmac_setladrf(struct bmac_softc *sc) { + struct arpcom *ac = &sc->arpcom; struct ifnet *ifp = &sc->arpcom.ac_if; struct ether_multi *enm; struct ether_multistep step; @@ -867,28 +868,17 @@ bmac_setladrf(struct bmac_softc *sc) return; } + if (ac->ac_multirangecnt > 0) + ifp->if_flags |= IFF_ALLMULTI; + if (ifp->if_flags & IFF_ALLMULTI) { hash[3] = hash[2] = hash[1] = hash[0] = 0xffff; goto chipit; } hash[3] = hash[2] = hash[1] = hash[0] = 0; - ETHER_FIRST_MULTI(step, &sc->arpcom, enm); + ETHER_FIRST_MULTI(step, ac, enm); while (enm != NULL) { - if (bcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) { - /* - * We must listen to a range of multicast addresses. - * For now, just accept all multicasts, rather than - * trying to set only those filter bits needed to match - * the range. (At this time, the only use of address - * ranges is for IP multicast routing, for which the - * range is big enough to require all bits set.) - */ - hash[3] = hash[2] = hash[1] = hash[0] = 0xffff; - ifp->if_flags |= IFF_ALLMULTI; - goto chipit; - } - crc = ether_crc32_le(enm->enm_addrlo, ETHER_ADDR_LEN); /* Just want the 6 most significant bits. */ diff --git a/sys/arch/macppc/dev/if_mc.c b/sys/arch/macppc/dev/if_mc.c index bae8832b26b..36693acc7b7 100644 --- a/sys/arch/macppc/dev/if_mc.c +++ b/sys/arch/macppc/dev/if_mc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mc.c,v 1.15 2013/08/07 22:22:42 bluhm Exp $ */ +/* $OpenBSD: if_mc.c,v 1.16 2013/10/23 10:31:19 mpi Exp $ */ /* $NetBSD: if_mc.c,v 1.9.16.1 2006/06/21 14:53:13 yamt Exp $ */ /*- @@ -1121,21 +1121,12 @@ mace_calcladrf(struct mc_softc *sc, u_int8_t *af) * the word. */ + if (ac->ac_multirangecnt > 0) + goto allmulti; + *((u_int32_t *)af) = *((u_int32_t *)af + 1) = 0; ETHER_FIRST_MULTI(step, ac, enm); while (enm != NULL) { - if (bcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) { - /* - * We must listen to a range of multicast addresses. - * For now, just accept all multicasts, rather than - * trying to set only those filter bits needed to match - * the range. (At this time, the only use of address - * ranges is for IP multicast routing, for which the - * range is big enough to require all bits set.) - */ - goto allmulti; - } - crc = ether_crc32_le(enm->enm_addrlo, sizeof(enm->enm_addrlo)); /* Just want the 6 most significant bits. */ |