Re: [PATCH V3] netfilter: netns nf_conntrack: per-netns net.netfilter.nf_conntrack_max sysctl

Florian Westphal
2025-04-09T07:20:42Z

lvxiafei <xiafei_xupt@163.com> wrote:
> - if (nf_conntrack_max && unlikely(ct_count > nf_conntrack_max)) {
> + if (net->ct.sysctl_max && unlikely(ct_count > min(nf_conntrack_max, net->ct.sysctl_max))) {
> if (!early_drop(net, hash)) {
> if (!conntrack_gc_work.early_drop)
> conntrack_gc_work.early_drop = true;
> diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
> index 2f666751c7e7..4a073c4de1b7 100644
> --- a/net/netfilter/nf_conntrack_standalone.c
> +++ b/net/netfilter/nf_conntrack_standalone.c
> @@ -615,7 +615,7 @@ enum nf_ct_sysctl_index {
> static struct ctl_table nf_ct_sysctl_table[] = {
> [NF_SYSCTL_CT_MAX] = {
> .procname = "nf_conntrack_max",
> - .data = &nf_conntrack_max,
> + .data = &init_net.ct.sysctl_max,

Whats the function of nf_conntrack_max?
After this change its always 0?