net: sched: remove check for number of actions in tcf_exts_exec
authorJiri Pirko <jiri@mellanox.com>
Fri, 4 Aug 2017 12:29:02 +0000 (14:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Aug 2017 18:21:23 +0000 (11:21 -0700)
Leave it to tcf_action_exec to return TC_ACT_OK in case there is no
action present.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/pkt_cls.h
net/sched/act_api.c

index 61ce521688b268db9192dd4af1249573f0baba17..b8959c9a190d4cd6123f892ed6bca64257e0950c 100644 (file)
@@ -192,9 +192,7 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
              struct tcf_result *res)
 {
 #ifdef CONFIG_NET_CLS_ACT
-       if (tcf_exts_has_actions(exts))
-               return tcf_action_exec(skb, exts->actions, exts->nr_actions,
-                                      res);
+       return tcf_action_exec(skb, exts->actions, exts->nr_actions, res);
 #endif
        return TC_ACT_OK;
 }
index f19b118df4143011a8a201a1e97f41137bcf368c..a2915d95827944dcf762c962d2b925dcd9602916 100644 (file)
@@ -473,9 +473,10 @@ static struct tc_action_ops *tc_lookup_action(struct nlattr *kind)
 int tcf_action_exec(struct sk_buff *skb, struct tc_action **actions,
                    int nr_actions, struct tcf_result *res)
 {
-       int ret = -1, i;
        u32 jmp_prgcnt = 0;
        u32 jmp_ttl = TCA_ACT_MAX_PRIO; /*matches actions per filter */
+       int i;
+       int ret = TC_ACT_OK;
 
        if (skb_skip_tc_classify(skb))
                return TC_ACT_OK;