svn commit: r337441 - head/sys/dev/usb/net
Kevin Lo
kevlo at FreeBSD.org
Wed Aug 8 01:20:03 UTC 2018
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;
}
/**
More information about the svn-src-all
mailing list