summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2026-07-10 09:54:09 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2026-07-24 11:22:30 +0200
commitedd51a23343870dbd7cedf6e2765c13cf7a5ccbc (patch)
treeec805fbde51351866e539d77590631185779cd3e /include
parent16aecbe3036f6097c26b51b12e4c1cf207769690 (diff)
downloadlinux-edd51a23343870dbd7cedf6e2765c13cf7a5ccbc.tar.gz
linux-edd51a23343870dbd7cedf6e2765c13cf7a5ccbc.zip
netfilter: flowtable: tear down flow entries with stale dst from GC
In case of route updates, tear down flow entries with stale dst to give them a chance to obtain a fresh route. This is specifically useful for hardware offloaded entries, where the flowtable software dataplane sees no packet, where the existing check for stale dst entries does not help. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/netfilter/nf_flow_table.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_flow_table.h b/include/net/netfilter/nf_flow_table.h
index ce414118962f..a090ec3ffef2 100644
--- a/include/net/netfilter/nf_flow_table.h
+++ b/include/net/netfilter/nf_flow_table.h
@@ -310,6 +310,14 @@ int flow_offload_add(struct nf_flowtable *flow_table, struct flow_offload *flow)
void flow_offload_refresh(struct nf_flowtable *flow_table,
struct flow_offload *flow, bool force);
+static inline bool nf_flow_dst_check(struct flow_offload_tuple *tuple)
+{
+ if (!tuple->dst_cache)
+ return true;
+
+ return dst_check(tuple->dst_cache, tuple->dst_cookie);
+}
+
struct flow_offload_tuple_rhash *flow_offload_lookup(struct nf_flowtable *flow_table,
struct flow_offload_tuple *tuple);
void nf_flow_table_gc_run(struct nf_flowtable *flow_table);