summaryrefslogtreecommitdiff
path: root/sys/arch/vax
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2013-11-27 08:56:32 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2013-11-27 08:56:32 +0000
commitd70b558eaecf6823288e17f5683065768969bdad (patch)
treeb98894a95e829c95bc340d7b1b383debc1a5a540 /sys/arch/vax
parent6cdb5c8b6ea31a7a272ec3e4207a0fe258f8e4c6 (diff)
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/arch/vax')
-rw-r--r--sys/arch/vax/if/if_qe.c19
-rw-r--r--sys/arch/vax/if/sgec.c18
2 files changed, 23 insertions, 14 deletions
diff --git a/sys/arch/vax/if/if_qe.c b/sys/arch/vax/if/if_qe.c
index 7d815f78543..105ae1d0609 100644
--- a/sys/arch/vax/if/if_qe.c
+++ b/sys/arch/vax/if/if_qe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_qe.c,v 1.25 2010/09/20 06:33:47 matthew Exp $ */
+/* $OpenBSD: if_qe.c,v 1.26 2013/11/27 08:56:31 mpi Exp $ */
/* $NetBSD: if_qe.c,v 1.51 2002/06/08 12:28:37 ragge Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -747,7 +747,8 @@ qe_setup(struct qe_softc *sc)
struct ether_multistep step;
struct qe_cdata *qc = sc->sc_qedata;
struct ifnet *ifp = &sc->sc_if;
- u_int8_t *enaddr = sc->sc_ac.ac_enaddr;
+ struct arpcom *ac = &sc->sc_ac;
+ u_int8_t *enaddr = ac->ac_enaddr;
int i, j, k, idx, s;
s = splnet();
@@ -770,12 +771,14 @@ qe_setup(struct qe_softc *sc)
*/
j = 3; k = 0;
ifp->if_flags &= ~IFF_ALLMULTI;
- ETHER_FIRST_MULTI(step, &sc->sc_ac, enm);
+
+ if (ac->ac_multirangecnt > 0) {
+ ifp->if_flags |= IFF_ALLMULTI;
+ goto setit;
+ }
+
+ ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- if (memcmp(enm->enm_addrlo, enm->enm_addrhi, 6)) {
- ifp->if_flags |= IFF_ALLMULTI;
- break;
- }
for (i = 0; i < ETHER_ADDR_LEN; i++)
qc->qc_setup[i * 8 + j + k] = enm->enm_addrlo[i];
j++;
@@ -788,6 +791,8 @@ qe_setup(struct qe_softc *sc)
}
ETHER_NEXT_MULTI(step, enm);
}
+
+setit:
idx = sc->sc_nexttx;
qc->qc_xmit[idx].qe_buf_len = -64;
diff --git a/sys/arch/vax/if/sgec.c b/sys/arch/vax/if/sgec.c
index 11abaa67089..88d6a649432 100644
--- a/sys/arch/vax/if/sgec.c
+++ b/sys/arch/vax/if/sgec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sgec.c,v 1.20 2011/09/26 21:44:04 miod Exp $ */
+/* $OpenBSD: sgec.c,v 1.21 2013/11/27 08:56:31 mpi Exp $ */
/* $NetBSD: sgec.c,v 1.5 2000/06/04 02:14:14 matt Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -767,7 +767,8 @@ ze_setup(sc)
struct ether_multistep step;
struct ze_cdata *zc = sc->sc_zedata;
struct ifnet *ifp = &sc->sc_if;
- u_int8_t *enaddr = sc->sc_ac.ac_enaddr;
+ struct arpcom *ac = &sc->sc_ac;
+ u_int8_t *enaddr = ac->ac_enaddr;
int j, idx, s, reg;
s = splnet();
@@ -790,12 +791,14 @@ ze_setup(sc)
*/
j = 16;
ifp->if_flags &= ~IFF_ALLMULTI;
- ETHER_FIRST_MULTI(step, &sc->sc_ac, enm);
+
+ if (ac->ac_multirangecnt > 0) {
+ ifp->if_flags |= IFF_ALLMULTI;
+ goto setit;
+ }
+
+ ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- if (bcmp(enm->enm_addrlo, enm->enm_addrhi, 6)) {
- ifp->if_flags |= IFF_ALLMULTI;
- break;
- }
bcopy(enm->enm_addrlo, &zc->zc_setup[j], ETHER_ADDR_LEN);
j += 8;
ETHER_NEXT_MULTI(step, enm);
@@ -805,6 +808,7 @@ ze_setup(sc)
}
}
+setit:
/*
* Fiddle with the receive logic.
*/