diff options
author | 2012-05-22 19:24:59 +0000 | |
---|---|---|
committer | 2012-05-22 19:24:59 +0000 | |
commit | 0a9ddb6a69f925635201e18e4569c57d22a79396 (patch) | |
tree | c6e6bc21c30791a49d599c106628afa0efb4c5cb | |
parent | Store client in tty struct directly instead of using a callback function (diff) | |
download | wireguard-openbsd-0a9ddb6a69f925635201e18e4569c57d22a79396.tar.xz wireguard-openbsd-0a9ddb6a69f925635201e18e4569c57d22a79396.zip |
When setting up the multicast filter, use the ac_multicnt field of the arpcom
struct to know if there are multicast entries, instead of counting the
number of entries in the list. No functional change. From brad.
-rw-r--r-- | sys/arch/sgi/dev/if_iec.c | 6 | ||||
-rw-r--r-- | sys/arch/sgi/dev/if_mec.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/arch/sgi/dev/if_iec.c b/sys/arch/sgi/dev/if_iec.c index 11b2b4a5d47..bb4ae5c7169 100644 --- a/sys/arch/sgi/dev/if_iec.c +++ b/sys/arch/sgi/dev/if_iec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iec.c,v 1.7 2010/03/15 18:59:09 miod Exp $ */ +/* $OpenBSD: if_iec.c,v 1.8 2012/05/22 19:24:59 miod Exp $ */ /* * Copyright (c) 2009 Miodrag Vallat. @@ -1108,7 +1108,6 @@ iec_iff(struct iec_softc *sc) bus_space_handle_t sh = sc->sc_sh; uint64_t mchash = 0; uint32_t hash; - int mcnt = 0; sc->sc_mcr &= ~IOC3_ENET_MCR_PROMISC; ifp->if_flags &= ~IFF_ALLMULTI; @@ -1123,8 +1122,9 @@ iec_iff(struct iec_softc *sc) while (enm != NULL) { hash = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN) >> 26; + mchash |= 1 << hash; - mcnt++; + ETHER_NEXT_MULTI(step, enm); } } diff --git a/sys/arch/sgi/dev/if_mec.c b/sys/arch/sgi/dev/if_mec.c index c069c5a5df7..368be93155e 100644 --- a/sys/arch/sgi/dev/if_mec.c +++ b/sys/arch/sgi/dev/if_mec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mec.c,v 1.23 2010/03/15 18:59:09 miod Exp $ */ +/* $OpenBSD: if_mec.c,v 1.24 2012/05/22 19:24:59 miod Exp $ */ /* $NetBSD: if_mec_mace.c,v 1.5 2004/08/01 06:36:36 tsutsui Exp $ */ /* @@ -1115,7 +1115,6 @@ mec_iff(struct mec_softc *sc) bus_space_handle_t sh = sc->sc_sh; uint64_t mchash = 0; uint32_t control, hash; - int mcnt = 0; control = bus_space_read_8(st, sh, MEC_MAC_CONTROL); control &= ~MEC_MAC_FILTER_MASK; @@ -1133,12 +1132,13 @@ mec_iff(struct mec_softc *sc) while (enm != NULL) { hash = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN) >> 26; + mchash |= 1 << hash; - mcnt++; + ETHER_NEXT_MULTI(step, enm); } - if (mcnt > 0) + if (ac->ac_multicnt > 0) control |= MEC_MAC_FILTER_MATCHMULTI; } |