diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-06-06 17:56:38 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-06-06 17:56:38 +0000 |
commit | b66d62c67d0c6e9c9e272002eb94f76bae347204 (patch) | |
tree | b1065a5eafec1ecf572afc4d953b647595905f87 /sys/dev/isa/if_ed.c | |
parent | c2d42bcab482d8ff7df96f4a747d47aacb855904 (diff) |
Multicast cleanups
- make multicast ranges work
- replace handrolled crc code with ether_crc32_{be,le}()
- add missing calls to ether_{add,del}multi()
ok deraadt@
Diffstat (limited to 'sys/dev/isa/if_ed.c')
-rw-r--r-- | sys/dev/isa/if_ed.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/sys/dev/isa/if_ed.c b/sys/dev/isa/if_ed.c index 5fbcec670d3..b74cd90ee28 100644 --- a/sys/dev/isa/if_ed.c +++ b/sys/dev/isa/if_ed.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ed.c,v 1.52 2004/05/12 06:35:10 tedu Exp $ */ +/* $OpenBSD: if_ed.c,v 1.53 2004/06/06 17:56:36 mcbride Exp $ */ /* $NetBSD: if_ed.c,v 1.105 1996/10/21 22:40:45 thorpej Exp $ */ /* @@ -2860,9 +2860,8 @@ ed_getmcaf(ac, af) { struct ifnet *ifp = &ac->ac_if; struct ether_multi *enm; - register u_char *cp, c; register u_int32_t crc; - register int i, len; + register int i; struct ether_multistep step; /* @@ -2897,22 +2896,8 @@ ed_getmcaf(ac, af) return; } - cp = enm->enm_addrlo; - crc = 0xffffffff; - for (len = sizeof(enm->enm_addrlo); --len >= 0;) { - c = *cp++; - for (i = 8; --i >= 0;) { - if (((crc & 0x80000000) ? 1 : 0) - ^ (c & 0x01)) { - crc <<= 1; - crc ^= 0x04c11db6 | 1; - } else - crc <<= 1; - c >>= 1; - } - } /* Just want the 6 most significant bits. */ - crc >>= 26; + crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN) >> 26; /* Turn on the corresponding bit in the filter. */ af[crc >> 5] |= 1 << ((crc & 0x1f) ^ 0); |