git: 3fc1786aa2a3 - main - igc: fix data type in MAC hash

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Tue, 11 Aug 2026 21:00:04 UTC
The branch main has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=3fc1786aa2a3f590453abb6ea2351a12e19f6b45

commit 3fc1786aa2a3f590453abb6ea2351a12e19f6b45
Author:     Barbara Skobiej <barbara.skobiej@intel.com>
AuthorDate: 2026-08-11 19:34:13 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-11 20:59:32 +0000

    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
---
 sys/dev/igc/igc_mac.c | 6 ++++--
 1 file 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;
 }