summaryrefslogtreecommitdiffstats
path: root/sys/dev/ffec
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2014-03-08 14:58:39 +0000
committerhrs <hrs@FreeBSD.org>2014-03-08 14:58:39 +0000
commit76e28c4f1adea7d40728009251c9797420aebc1f (patch)
tree927fcd05d4002fc678d4bf2d41a6741d3385e6cc /sys/dev/ffec
parentc1c5cdf1e1d0a877aa3855dece3cae97a11d0693 (diff)
downloadFreeBSD-src-76e28c4f1adea7d40728009251c9797420aebc1f.zip
FreeBSD-src-76e28c4f1adea7d40728009251c9797420aebc1f.tar.gz
Fix another bug in multicast filtering. i.MX uses 6 bits from MSB in
LE CRC32 for the hash value, not the lowest 6 bits in BE CRC32. Tested by: Takanori Sawada PR: arm/187179
Diffstat (limited to 'sys/dev/ffec')
-rw-r--r--sys/dev/ffec/if_ffec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/ffec/if_ffec.c b/sys/dev/ffec/if_ffec.c
index 203af9b..8a4984e 100644
--- a/sys/dev/ffec/if_ffec.c
+++ b/sys/dev/ffec/if_ffec.c
@@ -959,9 +959,10 @@ ffec_setup_rxfilter(struct ffec_softc *sc)
TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
- crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
+ /* 6 bits from MSB in LE CRC32 are used for hash. */
+ crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
ifma->ifma_addr), ETHER_ADDR_LEN);
- ghash |= 1LLU << (crc & 0x3f);
+ ghash |= 1LLU << (((uint8_t *)&crc)[3] >> 2);
}
if_maddr_runlock(ifp);
}
OpenPOWER on IntegriCloud