Drivers need to be updated to support this, return EBUSY by now.

Signed-off-by: Pablo Neira Ayuso <[email protected]>
---
v2: no changes.

 net/core/flow_offload.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c
index 0b8d088d822e..8c20f4740800 100644
--- a/net/core/flow_offload.c
+++ b/net/core/flow_offload.c
@@ -206,6 +206,12 @@ struct flow_block_cb *flow_block_cb_alloc(struct net *net, 
tc_setup_cb_t *cb,
 {
        struct flow_block_cb *block_cb;
 
+       list_for_each_entry(block_cb, &flow_block_cb_list, global_list) {
+               if (block_cb->cb == cb &&
+                   block_cb->cb_ident == cb_ident)
+                       return ERR_PTR(-EBUSY);
+       }
+
        block_cb = kzalloc(sizeof(*block_cb), GFP_KERNEL);
        if (IS_ERR(block_cb))
                return block_cb;
-- 
2.11.0

Reply via email to