netfilter: flowtable: Add FLOW_OFFLOAD_XMIT_UNSPEC xmit type
Subsystems (3)
PATCH v2 1/1 netfilter: flowtable: Add FLOW_OFFLOAD_XMIT_UNSPEC xmit type
It could be xmit type was not set and would default to FLOW_OFFLOAD_XMIT_NEIGH and in this type the gc expect to have a route info.
Fix that by adding FLOW_OFFLOAD_XMIT_UNSPEC which defaults to 0.
---
Notes:
v2
- add FLOW_OFFLOAD_XMIT_UNSPEC instead of still using neigh as default and checking dst for null
include/net/netfilter/nf_flow_table.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/net/netfilter/nf_flow_table.h +2 -1
@@ -90,7 +90,8 @@ enum flow_offload_tuple_dir {#define FLOW_OFFLOAD_DIR_MAX IP_CT_DIR_MAXenum flow_offload_xmit_type { -FLOW_OFFLOAD_XMIT_NEIGH =0 , +FLOW_OFFLOAD_XMIT_UNSPEC =0 , +FLOW_OFFLOAD_XMIT_NEIGH ,FLOW_OFFLOAD_XMIT_XFRM ,FLOW_OFFLOAD_XMIT_DIRECT , };
Signature · 1 line
2.26.2
Quoted 3 lines · Roi Dayan
It could be xmit type was not set and would default to
FLOW_OFFLOAD_XMIT_NEIGHand in this type the gc expect to have a route info.
Fix that by addingFLOW_OFFLOAD_XMIT_UNSPECwhich defaults to 0.
Applied, thanks.
net/netfilter/nf_flow_table_core.c +3 -0
@@ -130,6 +130,9 @@ static int flow_offload_fill_route(struct flow_offload *flow, flow_tuple->dst_cache = dst; flow_tuple->dst_cookie =flow_offload_dst_cookie (flow_tuple);break ; +default : +WARN_ON_ONCE (1 ); +break ; } flow_tuple->xmit_type = route->tuple[dir].xmit_type;
I have included this chunk to make gcc happy.
net/netfilter/nf_flow_table_core.c: In function ‘flow_offload_fill_route’:net/netfilter/nf_flow_table_core.c:116:2: warning: enumeration value ‘FLOW_OFFLOAD_XMIT_UNSPEC’ not handled in switch [-Wswitch]
116 | switch (route->tuple[dir].xmit_type) {
| ^~~~~~