mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-12 03:06:46 +07:00
netfilter: ipset: Make sure element data size is a multiple of u32
Data for hashing required to be array of u32. Make sure that element data always multiple of u32. Ported from a patch proposed by Sergey Popovich <popovich_sergei@mail.ua>. Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
This commit is contained in:
parent
cee8b97b6c
commit
5a902e6d4b
@ -260,8 +260,14 @@ htable_bits(u32 hashsize)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HKEY(data, initval, htable_bits) \
|
#define HKEY(data, initval, htable_bits) \
|
||||||
(jhash2((u32 *)(data), HKEY_DATALEN / sizeof(u32), initval) \
|
({ \
|
||||||
& jhash_mask(htable_bits))
|
const u32 *__k = (const u32 *)data; \
|
||||||
|
u32 __l = HKEY_DATALEN / sizeof(u32); \
|
||||||
|
\
|
||||||
|
BUILD_BUG_ON(HKEY_DATALEN % sizeof(u32) != 0); \
|
||||||
|
\
|
||||||
|
jhash2(__k, __l, initval) & jhash_mask(htable_bits); \
|
||||||
|
})
|
||||||
|
|
||||||
#ifndef htype
|
#ifndef htype
|
||||||
#ifndef HTYPE
|
#ifndef HTYPE
|
||||||
|
Loading…
Reference in New Issue
Block a user