Files
Fernando Fernandez Mancera 6e86f0eca8 netfilter: nf_conncount: rework API to use sk_buff directly
[ Upstream commit be102eb6a0 ]

When using nf_conncount infrastructure for non-confirmed connections a
duplicated track is possible due to an optimization introduced since
commit d265929930 ("netfilter: nf_conncount: reduce unnecessary GC").

In order to fix this introduce a new conncount API that receives
directly an sk_buff struct.  It fetches the tuple and zone and the
corresponding ct from it. It comes with both existing conncount variants
nf_conncount_count_skb() and nf_conncount_add_skb(). In addition remove
the old API and adjust all the users to use the new one.

This way, for each sk_buff struct it is possible to check if there is a
ct present and already confirmed. If so, skip the add operation.

Fixes: d265929930 ("netfilter: nf_conncount: reduce unnecessary GC")
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stable-dep-of: 69894e5b4c ("netfilter: nft_connlimit: update the count if add was skipped")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-01-19 13:11:35 +01:00
..
2021-06-10 13:39:24 +02:00
2020-05-05 13:23:29 -07:00
2019-12-09 10:36:44 -08:00
2020-06-22 21:12:44 -07:00
2024-12-19 18:06:10 +01:00
2020-03-04 13:25:55 -08:00
2023-06-14 11:09:42 +02:00
2019-04-22 21:47:25 -07:00
2019-10-05 16:29:00 -07:00
2025-06-27 11:04:09 +01:00
2020-06-18 20:46:23 -07:00
2023-08-11 11:57:50 +02:00
2019-12-09 10:28:43 -08:00