Skip to content

Commit aa58401

Browse files
lvxiafeiummakynes
authored andcommitted
netfilter: conntrack: table full detailed log
Add the netns field in the "nf_conntrack: table full, dropping packet" log to help locate the specific netns when the table is full. Signed-off-by: lvxiafei <lvxiafei@sensetime.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent faa6099 commit aa58401

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/netfilter/nf_conntrack_core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,11 @@ __nf_conntrack_alloc(struct net *net,
16731673
if (!conntrack_gc_work.early_drop)
16741674
conntrack_gc_work.early_drop = true;
16751675
atomic_dec(&cnet->count);
1676-
net_warn_ratelimited("nf_conntrack: table full, dropping packet\n");
1676+
if (net == &init_net)
1677+
net_warn_ratelimited("nf_conntrack: table full, dropping packet\n");
1678+
else
1679+
net_warn_ratelimited("nf_conntrack: table full in netns %u, dropping packet\n",
1680+
net->ns.inum);
16771681
return ERR_PTR(-ENOMEM);
16781682
}
16791683
}

0 commit comments

Comments
 (0)