From b0478c2bb7ba3e68bf6a59aab44a8f9a5fcf89aa Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Sat, 8 Mar 2014 14:58:39 +0000 Subject: 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 --- sys/dev/ffec/if_ffec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/dev/ffec') diff --git a/sys/dev/ffec/if_ffec.c b/sys/dev/ffec/if_ffec.c index 203af9baaf38..8a4984e01c15 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); } -- cgit v1.3