]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
netfilter: conntrack: sanitize table size default settings
authorFlorian Westphal <fw@strlen.de>
Thu, 26 Aug 2021 13:54:19 +0000 (15:54 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 30 Aug 2021 09:49:54 +0000 (11:49 +0200)
commitd532bcd0b2699d84d71a0c71d37157ac6eb3be25
treeaf1c997d9ea725f60249456b7b04f0c4500d4305
parente3245a7b7b34bd2e97f744fd79463add6e9d41f4
netfilter: conntrack: sanitize table size default settings

conntrack has two distinct table size settings:
nf_conntrack_max and nf_conntrack_buckets.

The former limits how many conntrack objects are allowed to exist
in each namespace.

The second sets the size of the hashtable.

As all entries are inserted twice (once for original direction, once for
reply), there should be at least twice as many buckets in the table than
the maximum number of conntrack objects that can exist at the same time.

Change the default multiplier to 1 and increase the chosen bucket sizes.
This results in the same nf_conntrack_max settings as before but reduces
the average bucket list length.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Documentation/networking/nf_conntrack-sysctl.rst
net/netfilter/nf_conntrack_core.c