diff options
| author | Barbara Skobiej <barbara.skobiej@intel.com> | 2026-08-11 19:34:13 +0000 |
|---|---|---|
| committer | Kevin Bowling <kbowling@FreeBSD.org> | 2026-08-11 20:59:32 +0000 |
| commit | 3fc1786aa2a3f590453abb6ea2351a12e19f6b45 (patch) | |
| tree | c80e91d394be14f61f545352e48b3ece7dd77ff0 | |
| parent | cba56bc3427db0bb4efc3d0117cda4bdc7717f98 (diff) | |
igc: fix data type in MAC hash
DPDK commit message
net/e1000/base: fix data type in MAC hash
One of the bit shifts in MAC hash calculation triggers a static analysis
warning about a potential overflow. Fix the data type to avoid this.
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Barbara Skobiej <barbara.skobiej@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Obtained from: DPDK (458734aaac)
MFC after: 2 weeks
| -rw-r--r-- | sys/dev/igc/igc_mac.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/igc/igc_mac.c b/sys/dev/igc/igc_mac.c index 2c32f0c7a606..add6a7327ab6 100644 --- a/sys/dev/igc/igc_mac.c +++ b/sys/dev/igc/igc_mac.c @@ -354,8 +354,10 @@ u32 igc_hash_mc_addr_generic(struct igc_hw *hw, u8 *mc_addr) break; } - hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) | - (((u16) mc_addr[5]) << bit_shift))); + hash_value = (u32)mc_addr[4]; + hash_value >>= 8 - bit_shift; + hash_value |= (u32)mc_addr[5] << bit_shift; + hash_value &= hash_mask; return hash_value; } |
