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/isa | |
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/isa')
-rw-r--r-- | sys/dev/isa/if_ie.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/dev/isa/if_ie.c b/sys/dev/isa/if_ie.c index 5eca03b635c..e33529b6f3b 100644 --- a/sys/dev/isa/if_ie.c +++ b/sys/dev/isa/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.37 2013/08/07 01:06:32 bluhm Exp $ */ +/* $OpenBSD: if_ie.c,v 1.38 2013/11/26 09:50:33 mpi Exp $ */ /* $NetBSD: if_ie.c,v 1.51 1996/05/12 23:52:48 mycroft Exp $ */ /*- @@ -2192,19 +2192,24 @@ static void mc_reset(sc) struct ie_softc *sc; { + struct arpcom *ac = &sc->sc_arpcom; struct ether_multi *enm; struct ether_multistep step; + if (ac->ac_multirangecnt > 0) { + ac->ac_if.if_flags |= IFF_ALLMULTI; + ieioctl(&ac->ac_if, SIOCSIFFLAGS, (void *)0); + goto setflag; + } /* * Step through the list of addresses. */ sc->mcast_count = 0; - ETHER_FIRST_MULTI(step, &sc->sc_arpcom, enm); + ETHER_FIRST_MULTI(step, ac, enm); while (enm) { - if (sc->mcast_count >= MAXMCAST || - bcmp(enm->enm_addrlo, enm->enm_addrhi, 6) != 0) { - sc->sc_arpcom.ac_if.if_flags |= IFF_ALLMULTI; - ieioctl(&sc->sc_arpcom.ac_if, SIOCSIFFLAGS, (void *)0); + if (sc->mcast_count >= MAXMCAST) { + ac->ac_if.if_flags |= IFF_ALLMULTI; + ieioctl(&ac->ac_if, SIOCSIFFLAGS, (void *)0); goto setflag; } |