summaryrefslogtreecommitdiff
path: root/sys/dev/ic/i82596.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-09-10 06:13:00 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-09-10 06:13:00 +0000
commit38a5b6874f579b78d863a8d5193616ca044e80a9 (patch)
treec78006952d25af9440509769176318b547869760 /sys/dev/ic/i82596.c
parent339fe31e05634267bf4e6a17393efb68a2bd899a (diff)
Fix setting up the multicast filter. Fixes PR 5474.
"looks right" deraadt@
Diffstat (limited to 'sys/dev/ic/i82596.c')
-rw-r--r--sys/dev/ic/i82596.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/dev/ic/i82596.c b/sys/dev/ic/i82596.c
index 0d8caf3803d..70f22039b3d 100644
--- a/sys/dev/ic/i82596.c
+++ b/sys/dev/ic/i82596.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82596.c,v 1.26 2006/03/25 22:41:43 djm Exp $ */
+/* $OpenBSD: i82596.c,v 1.27 2007/09/10 06:12:59 kettenis Exp $ */
/* $NetBSD: i82586.c,v 1.18 1998/08/15 04:42:42 mycroft Exp $ */
/*-
@@ -1974,19 +1974,20 @@ ie_mc_reset(sc)
/*
* Step through the list of addresses.
*/
-again:
size = 0;
sc->mcast_count = 0;
ETHER_FIRST_MULTI(step, &sc->sc_arpcom, enm);
while (enm) {
- size += 6;
+ size += ETHER_ADDR_LEN;
if (sc->mcast_count >= IE_MAXMCAST ||
- bcmp(enm->enm_addrlo, enm->enm_addrhi, 6) != 0) {
+ bcmp(enm->enm_addrlo, enm->enm_addrhi,
+ ETHER_ADDR_LEN) != 0) {
sc->sc_arpcom.ac_if.if_flags |= IFF_ALLMULTI;
i82596_ioctl(&sc->sc_arpcom.ac_if,
SIOCSIFFLAGS, (void *)0);
return;
}
+ sc->mcast_count++;
ETHER_NEXT_MULTI(step, enm);
}
@@ -2002,12 +2003,12 @@ again:
/*
* We've got the space; now copy the addresses
*/
+ sc->mcast_count = 0;
ETHER_FIRST_MULTI(step, &sc->sc_arpcom, enm);
while (enm) {
- if (sc->mcast_count >= IE_MAXMCAST)
- goto again; /* Just in case */
-
- bcopy(enm->enm_addrlo, &sc->mcast_addrs[sc->mcast_count], 6);
+ bcopy(enm->enm_addrlo,
+ &sc->mcast_addrs[sc->mcast_count * ETHER_ADDR_LEN],
+ ETHER_ADDR_LEN);
sc->mcast_count++;
ETHER_NEXT_MULTI(step, enm);
}