Commit 133a2fe5 authored by wenxu's avatar wenxu Committed by Pablo Neira Ayuso

netfilter: flowtable: Fix incorrect tc_setup_type type

The indirect block setup should use TC_SETUP_FT as the type instead of
TC_SETUP_BLOCK. Adjust existing users of the indirect flow block
infrastructure.

Fixes: b5140a36 ("netfilter: flowtable: add indr block setup support")
Signed-off-by: default avatarwenxu <wenxu@ucloud.cn>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 53c2b289
...@@ -520,6 +520,7 @@ void flow_indr_block_cb_unregister(struct net_device *dev, ...@@ -520,6 +520,7 @@ void flow_indr_block_cb_unregister(struct net_device *dev,
void flow_indr_block_call(struct net_device *dev, void flow_indr_block_call(struct net_device *dev,
struct flow_block_offload *bo, struct flow_block_offload *bo,
enum flow_block_command command); enum flow_block_command command,
enum tc_setup_type type);
#endif /* _NET_FLOW_OFFLOAD_H */ #endif /* _NET_FLOW_OFFLOAD_H */
...@@ -511,7 +511,8 @@ EXPORT_SYMBOL_GPL(flow_indr_block_cb_unregister); ...@@ -511,7 +511,8 @@ EXPORT_SYMBOL_GPL(flow_indr_block_cb_unregister);
void flow_indr_block_call(struct net_device *dev, void flow_indr_block_call(struct net_device *dev,
struct flow_block_offload *bo, struct flow_block_offload *bo,
enum flow_block_command command) enum flow_block_command command,
enum tc_setup_type type)
{ {
struct flow_indr_block_cb *indr_block_cb; struct flow_indr_block_cb *indr_block_cb;
struct flow_indr_block_dev *indr_dev; struct flow_indr_block_dev *indr_dev;
...@@ -521,8 +522,7 @@ void flow_indr_block_call(struct net_device *dev, ...@@ -521,8 +522,7 @@ void flow_indr_block_call(struct net_device *dev,
return; return;
list_for_each_entry(indr_block_cb, &indr_dev->cb_list, list) list_for_each_entry(indr_block_cb, &indr_dev->cb_list, list)
indr_block_cb->cb(dev, indr_block_cb->cb_priv, TC_SETUP_BLOCK, indr_block_cb->cb(dev, indr_block_cb->cb_priv, type, bo);
bo);
} }
EXPORT_SYMBOL_GPL(flow_indr_block_call); EXPORT_SYMBOL_GPL(flow_indr_block_call);
......
...@@ -938,7 +938,7 @@ static int nf_flow_table_indr_offload_cmd(struct flow_block_offload *bo, ...@@ -938,7 +938,7 @@ static int nf_flow_table_indr_offload_cmd(struct flow_block_offload *bo,
{ {
nf_flow_table_block_offload_init(bo, dev_net(dev), cmd, flowtable, nf_flow_table_block_offload_init(bo, dev_net(dev), cmd, flowtable,
extack); extack);
flow_indr_block_call(dev, bo, cmd); flow_indr_block_call(dev, bo, cmd, TC_SETUP_FT);
if (list_empty(&bo->cb_list)) if (list_empty(&bo->cb_list))
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
...@@ -313,7 +313,7 @@ static int nft_indr_block_offload_cmd(struct nft_base_chain *chain, ...@@ -313,7 +313,7 @@ static int nft_indr_block_offload_cmd(struct nft_base_chain *chain,
nft_flow_block_offload_init(&bo, dev_net(dev), cmd, chain, &extack); nft_flow_block_offload_init(&bo, dev_net(dev), cmd, chain, &extack);
flow_indr_block_call(dev, &bo, cmd); flow_indr_block_call(dev, &bo, cmd, TC_SETUP_BLOCK);
if (list_empty(&bo.cb_list)) if (list_empty(&bo.cb_list))
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
...@@ -708,7 +708,7 @@ static void tc_indr_block_call(struct tcf_block *block, ...@@ -708,7 +708,7 @@ static void tc_indr_block_call(struct tcf_block *block,
}; };
INIT_LIST_HEAD(&bo.cb_list); INIT_LIST_HEAD(&bo.cb_list);
flow_indr_block_call(dev, &bo, command); flow_indr_block_call(dev, &bo, command, TC_SETUP_BLOCK);
tcf_block_setup(block, &bo); tcf_block_setup(block, &bo);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment