diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-03-08 16:29:25 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-03-08 16:32:33 +0100 |
commit | 3276471d23d4d96d55e9a0fb7a10983d8097dc45 (patch) | |
tree | eb8be0cd90291d893f50fc91777174bb6a27fff6 | |
parent | 0a0fef6916b4ab8530317f76a3057b918991686a (diff) |
conntrackd: set default hashtable buckets and max entries if not specified
Fall back to 65536 buckets and 262144 entries.
It would be probably good to add code to autoadjust by reading
/proc/sys/net/netfilter/nf_conntrack_buckets and
/proc/sys/net/nf_conntrack_max.
Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1491
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/read_config_yy.y | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/read_config_yy.y b/src/read_config_yy.y index 31109c4..b215a72 100644 --- a/src/read_config_yy.y +++ b/src/read_config_yy.y @@ -1780,5 +1780,11 @@ init_config(char *filename) NF_NETLINK_CONNTRACK_DESTROY; } + /* default hashtable buckets and maximum number of entries */ + if (!CONFIG(hashsize)) + CONFIG(hashsize) = 65536; + if (!CONFIG(limit)) + CONFIG(limit) = 262144; + return 0; } |