mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
simplify hash calculation
This commit is contained in:
parent
f0147e0a46
commit
80720032c0
1 changed files with 1 additions and 5 deletions
|
|
@ -384,12 +384,8 @@ static uint32_t
|
|||
ate_mac_hash(const uint8_t *buf)
|
||||
{
|
||||
uint32_t index = 0;
|
||||
uint8_t bit;
|
||||
uint8_t bitshift;
|
||||
for (int i = 0; i < 48; i++) {
|
||||
bit = i / 6;
|
||||
bitshift = i - bit * 6;
|
||||
index ^= ((buf[i >> 3] >> (i & 7)) & 1) << bitshift;
|
||||
index ^= ((buf[i >> 3] >> (i & 7)) & 1) << (i % 6);
|
||||
}
|
||||
return (index);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue