svn commit: r262929 - head/sys/dev/ffec
Hiroki Sato
hrs at FreeBSD.org
Sat Mar 8 14:58:40 UTC 2014
Author: hrs
Date: Sat Mar 8 14:58:39 2014
New Revision: 262929
URL: http://svnweb.freebsd.org/changeset/base/262929
Log:
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
Modified:
head/sys/dev/ffec/if_ffec.c
Modified: head/sys/dev/ffec/if_ffec.c
==============================================================================
--- head/sys/dev/ffec/if_ffec.c Sat Mar 8 12:26:17 2014 (r262928)
+++ head/sys/dev/ffec/if_ffec.c Sat Mar 8 14:58:39 2014 (r262929)
@@ -959,9 +959,10 @@ ffec_setup_rxfilter(struct ffec_softc *s
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);
}
More information about the svn-src-all
mailing list