-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel: fix bidirectional hardware flow offload
Fix a bug that was introduced upstream Signed-off-by: Felix Fietkau <[email protected]>
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o | ||
--- /dev/null | ||
+++ b/net/netfilter/xt_FLOWOFFLOAD.c | ||
@@ -0,0 +1,698 @@ | ||
@@ -0,0 +1,699 @@ | ||
+/* | ||
+ * Copyright (C) 2018-2021 Felix Fietkau <[email protected]> | ||
+ * | ||
|
@@ -574,6 +574,7 @@ Signed-off-by: Felix Fietkau <[email protected]> | |
+ if (!net) | ||
+ write_pnet(&table->ft.net, xt_net(par)); | ||
+ | ||
+ __set_bit(NF_FLOW_HW_BIDIRECTIONAL, &flow->flags); | ||
+ if (flow_offload_add(&table->ft, flow) < 0) | ||
+ goto err_flow_add; | ||
+ | ||
|
24 changes: 24 additions & 0 deletions
24
.../linux/generic/pending-6.1/704-netfilter-nf_tables-fix-bidirectional-offload-regres.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
From: Felix Fietkau <[email protected]> | ||
Date: Wed, 14 Feb 2024 15:24:41 +0100 | ||
Subject: [PATCH] netfilter: nf_tables: fix bidirectional offload regression | ||
|
||
Commit 8f84780b84d6 ("netfilter: flowtable: allow unidirectional rules") | ||
made unidirectional flow offload possible, while completely ignoring (and | ||
breaking) bidirectional flow offload for nftables. | ||
Add the missing flag that was left out as an exercise for the reader :) | ||
|
||
Cc: Vlad Buslov <[email protected]> | ||
Fixes: 8f84780b84d6 ("netfilter: flowtable: allow unidirectional rules") | ||
Signed-off-by: Felix Fietkau <[email protected]> | ||
--- | ||
|
||
--- a/net/netfilter/nft_flow_offload.c | ||
+++ b/net/netfilter/nft_flow_offload.c | ||
@@ -357,6 +357,7 @@ static void nft_flow_offload_eval(const | ||
ct->proto.tcp.seen[1].flags |= IP_CT_TCP_FLAG_BE_LIBERAL; | ||
} | ||
|
||
+ __set_bit(NF_FLOW_HW_BIDIRECTIONAL, &flow->flags); | ||
ret = flow_offload_add(flowtable, flow); | ||
if (ret < 0) | ||
goto err_flow_add; |