]> git.baikalelectronics.ru Git - kernel.git/commitdiff
flow_offload: return EOPNOTSUPP for the unsupported mpls action type
authorBaowen Zheng <baowen.zheng@corigine.com>
Mon, 13 Dec 2021 14:46:04 +0000 (15:46 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Dec 2021 12:33:19 +0000 (12:33 +0000)
We need to return EOPNOTSUPP for the unsupported mpls action type when
setup the flow action.

In the original implement, we will return 0 for the unsupported mpls
action type, actually we do not setup it and the following actions
to the flow action entry.

Fixes: bc5052d8e47f ("net: sched: take rtnl lock in tc_setup_flow_action()")
Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c

index 2ef8f5a6205a9d92c2195444cb0469702be93da5..e54f0a42270c1ba9f47bdb3968c11b5c777c8bb1 100644 (file)
@@ -3687,6 +3687,7 @@ int tc_setup_flow_action(struct flow_action *flow_action,
                                entry->mpls_mangle.ttl = tcf_mpls_ttl(act);
                                break;
                        default:
+                               err = -EOPNOTSUPP;
                                goto err_out_locked;
                        }
                } else if (is_tcf_skbedit_ptype(act)) {