diff options
author | 2013-11-26 09:50:32 +0000 | |
---|---|---|
committer | 2013-11-26 09:50:32 +0000 | |
commit | f2e23e596b1b06b721745d9632fc95f41b255c36 (patch) | |
tree | be9eb75816987c95e8df7407c902b63b863ffc84 /sys/dev/ic/lemac.c | |
parent | fix incorrectly converted CIRCLEQ_END comparison to prevent NULL deref's (diff) | |
download | wireguard-openbsd-f2e23e596b1b06b721745d9632fc95f41b255c36.tar.xz wireguard-openbsd-f2e23e596b1b06b721745d9632fc95f41b255c36.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 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/lemac.c')
-rw-r--r-- | sys/dev/ic/lemac.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/ic/lemac.c b/sys/dev/ic/lemac.c index 76d5470547d..30908ff4604 100644 --- a/sys/dev/ic/lemac.c +++ b/sys/dev/ic/lemac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lemac.c,v 1.14 2013/08/07 01:06:30 bluhm Exp $ */ +/* $OpenBSD: lemac.c,v 1.15 2013/11/26 09:50:33 mpi Exp $ */ /* $NetBSD: lemac.c,v 1.20 2001/06/13 10:46:02 wiz Exp $ */ /*- @@ -490,6 +490,7 @@ void lemac_multicast_filter(struct lemac_softc *sc) { #if 0 + struct arpcom *ac = &sc->sc_ec; struct ether_multistep step; struct ether_multi *enm; #endif @@ -499,13 +500,14 @@ lemac_multicast_filter(struct lemac_softc *sc) lemac_multicast_op(sc->sc_mctbl, etherbroadcastaddr, 1); #if 0 - ETHER_FIRST_MULTI(step, &sc->sc_ec, enm); + if (ac->ac_multirangecnt > 0) { + sc->sc_flags |= LEMAC_ALLMULTI; + sc->sc_if.if_flags |= IFF_ALLMULTI; + return; + } + + ETHER_FIRST_MULTI(step, ac, enm); while (enm != NULL) { - if (!LEMAC_ADDREQUAL(enm->enm_addrlo, enm->enm_addrhi)) { - sc->sc_flags |= LEMAC_ALLMULTI; - sc->sc_if.if_flags |= IFF_ALLMULTI; - return; - } lemac_multicast_op(sc->sc_mctbl, enm->enm_addrlo, TRUE); ETHER_NEXT_MULTI(step, enm); } |