62edb2c8118ac0461e09fe6a84a99748ec8a98f5
[openwrt/staging/xback.git] /
1 From 78ed0a9bc6db76f8e5f5f4cb0d2b2f0d1bb21b24 Mon Sep 17 00:00:00 2001
2 From: Roi Dayan <roid@nvidia.com>
3 Date: Tue, 13 Apr 2021 11:06:05 +0300
4 Subject: [PATCH] netfilter: flowtable: Add FLOW_OFFLOAD_XMIT_UNSPEC xmit type
5
6 It could be xmit type was not set and would default to FLOW_OFFLOAD_XMIT_NEIGH
7 and in this type the gc expect to have a route info.
8 Fix that by adding FLOW_OFFLOAD_XMIT_UNSPEC which defaults to 0.
9
10 Fixes: 8b9229d15877 ("netfilter: flowtable: dst_check() from garbage collector path")
11 Signed-off-by: Roi Dayan <roid@nvidia.com>
12 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 ---
14 include/net/netfilter/nf_flow_table.h | 3 ++-
15 net/netfilter/nf_flow_table_core.c | 3 +++
16 2 files changed, 5 insertions(+), 1 deletion(-)
17
18 --- a/include/net/netfilter/nf_flow_table.h
19 +++ b/include/net/netfilter/nf_flow_table.h
20 @@ -90,7 +90,8 @@ enum flow_offload_tuple_dir {
21 #define FLOW_OFFLOAD_DIR_MAX IP_CT_DIR_MAX
22
23 enum flow_offload_xmit_type {
24 - FLOW_OFFLOAD_XMIT_NEIGH = 0,
25 + FLOW_OFFLOAD_XMIT_UNSPEC = 0,
26 + FLOW_OFFLOAD_XMIT_NEIGH,
27 FLOW_OFFLOAD_XMIT_XFRM,
28 FLOW_OFFLOAD_XMIT_DIRECT,
29 };
30 --- a/net/netfilter/nf_flow_table_core.c
31 +++ b/net/netfilter/nf_flow_table_core.c
32 @@ -130,6 +130,9 @@ static int flow_offload_fill_route(struc
33 flow_tuple->dst_cache = dst;
34 flow_tuple->dst_cookie = flow_offload_dst_cookie(flow_tuple);
35 break;
36 + default:
37 + WARN_ON_ONCE(1);
38 + break;
39 }
40 flow_tuple->xmit_type = route->tuple[dir].xmit_type;
41