mirror-linux/include
Florian Westphal eaf9e7192e netfilter: conntrack: don't fold port numbers into addresses before hashing
Originally this used jhash2() over tuple and folded the zone id,
the pernet hash value, destination port and l4 protocol number into the
32bit seed value.

When the switch to siphash was done, I used an on-stack temporary
buffer to build a suitable key to be hashed via siphash().

But this showed up as performance regression, so I got rid of
the temporary copy and collected to-be-hashed data in 4 u64 variables.

This makes it easy to build tuples that produce the same hash, which isn't
desirable even though chain lengths are limited.

Switch back to plain siphash, but just like with jhash2(), take advantage
of the fact that most of to-be-hashed data is already in a suitable order.

Use an empty struct as annotation in 'struct nf_conntrack_tuple' to mark
last member that can be used as hash input.

The only remaining data that isn't present in the tuple structure are the
zone identifier and the pernet hash: fold those into the key.

Fixes: d2c806abcf ("netfilter: conntrack: use siphash_4u64")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2023-07-05 14:42:16 +02:00
..
acpi hardening updates for v6.5-rc1 2023-06-27 21:24:18 -07:00
asm-generic - Arnd Bergmann has fixed a bunch of -Wmissing-prototypes in 2023-06-28 10:59:38 -07:00
clocksource
crypto Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
drm
dt-bindings
keys
kunit
kvm
linux net: dsa: sja1105: always enable the send_meta options 2023-07-04 19:42:27 +01:00
math-emu
media
memory
misc
net netfilter: conntrack: don't fold port numbers into addresses before hashing 2023-07-05 14:42:16 +02:00
pcmcia
ras
rdma
rv
scsi
soc net: mscc: ocelot: don't keep PTP configuration of all ports in single structure 2023-06-29 12:40:27 +02:00
sound
target
trace net: Replace strlcpy with strscpy 2023-07-04 19:40:16 +01:00
uapi Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
ufs
vdso
video
xen x86: xen: add missing prototypes 2023-06-26 07:47:11 +02:00