netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/1] netfilter: conntrack: Check offload bit on table dump
@ 2021-01-28  7:40 Roi Dayan
  2021-01-30 12:01 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 10+ messages in thread
From: Roi Dayan @ 2021-01-28  7:40 UTC (permalink / raw)
  To: netdev; +Cc: Pablo Neira Ayuso, Paul Blakey, Oz Shlomo, Roi Dayan

Currently, offloaded flows might be deleted when executing conntrack -L
or cat /proc/net/nf_conntrack while rules being offloaded.
Ct timeout is not maintained for offloaded flows as aging
of offloaded flows are managed by the flow table offload infrastructure.

Don't do garbage collection for offloaded flows when dumping the
entries.

Fixes: 90964016e5d3 ("netfilter: nf_conntrack: add IPS_OFFLOAD status bit")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Oz Shlomo <ozsh@nvidia.com>
---
 include/net/netfilter/nf_conntrack.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 439379ca9ffa..87c85109946a 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -276,7 +276,7 @@ static inline bool nf_ct_is_expired(const struct nf_conn *ct)
 static inline bool nf_ct_should_gc(const struct nf_conn *ct)
 {
 	return nf_ct_is_expired(ct) && nf_ct_is_confirmed(ct) &&
-	       !nf_ct_is_dying(ct);
+	       !nf_ct_is_dying(ct) && !test_bit(IPS_OFFLOAD_BIT, &ct->status);
 }
 
 #define	NF_CT_DAY	(86400 * HZ)
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-02-07  8:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-28  7:40 [PATCH net 1/1] netfilter: conntrack: Check offload bit on table dump Roi Dayan
2021-01-30 12:01 ` Pablo Neira Ayuso
     [not found]   ` <3a29e9b5-7bf8-5c00-3ede-738f9b4725bf@nvidia.com>
     [not found]     ` <997cbda4-acd1-a000-1408-269bc5c3abf3@nvidia.com>
2021-02-01  3:08       ` Pablo Neira Ayuso
2021-02-01  7:53         ` Roi Dayan
2021-02-01 11:50           ` Florian Westphal
2021-02-01 15:04             ` Roi Dayan
2021-02-01 15:25               ` Florian Westphal
2021-02-02 17:08                 ` Roi Dayan
2021-02-03 12:50                   ` Florian Westphal
2021-02-07  8:38                     ` Roi Dayan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).