Date: Wed, 8 Aug 2018 01:20:02 +0000 (UTC) From: Kevin Lo <kevlo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337441 - head/sys/dev/usb/net Message-ID: <201808080120.w781K2Xa093693@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevlo Date: Wed Aug 8 01:20:02 2018 New Revision: 337441 URL: https://svnweb.freebsd.org/changeset/base/337441 Log: - Fix hash calculation by MAC address - Since rx_cmd_c is an uint16_t, use le16toh() instead of le32toh() Reviewed by: emaste Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Tue Aug 7 23:03:50 2018 (r337440) +++ head/sys/dev/usb/net/if_muge.c Wed Aug 8 01:20:02 2018 (r337441) @@ -1196,7 +1196,7 @@ muge_bulk_read_callback(struct usb_xfer *xfer, usb_err goto tr_setup; usbd_copy_out(pc, off, &rx_cmd_c, sizeof(rx_cmd_c)); off += (sizeof(rx_cmd_c)); - rx_cmd_c = le32toh(rx_cmd_c); + rx_cmd_c = le16toh(rx_cmd_c); if (off > actlen) goto tr_setup; @@ -1891,7 +1891,7 @@ muge_multicast_write(struct muge_softc *sc) static inline uint32_t muge_hash(uint8_t addr[ETHER_ADDR_LEN]) { - return (ether_crc32_be(addr, ETHER_ADDR_LEN) >> 26) & 0x3f; + return (ether_crc32_be(addr, ETHER_ADDR_LEN) >> 23) & 0x1ff; } /**
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808080120.w781K2Xa093693>