netfilter: allow exp not to be removed in nf_ct_find_expectation
authorXin Long <lucien.xin@gmail.com>
Sun, 16 Jul 2023 21:09:17 +0000 (17:09 -0400)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 20 Jul 2023 08:06:36 +0000 (10:06 +0200)
commit4914109a8e1e494c6aa9852f9e84ec77a5fc643f
tree05a768b1df8be3e69eb1e37ce3d63c2a9d93815b
parent03b123debcbc8db987bda17ed8412cc011064c22
netfilter: allow exp not to be removed in nf_ct_find_expectation

Currently nf_conntrack_in() calling nf_ct_find_expectation() will
remove the exp from the hash table. However, in some scenario, we
expect the exp not to be removed when the created ct will not be
confirmed, like in OVS and TC conntrack in the following patches.

This patch allows exp not to be removed by setting IPS_CONFIRMED
in the status of the tmpl.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/netfilter/nf_conntrack_expect.h
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_expect.c
net/netfilter/nft_ct.c