Date: Sat, 8 Mar 2014 14:58:40 +0000 (UTC) From: Hiroki Sato <hrs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262929 - head/sys/dev/ffec Message-ID: <201403081458.s28EwehV088580@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403081458.s28EwehV088580>