net: sched: use tcf_exts_has_actions instead of exts->nr_actions
authorJiri Pirko <jiri@mellanox.com>
Fri, 4 Aug 2017 12:29:03 +0000 (14:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Aug 2017 18:21:24 +0000 (11:21 -0700)
For check in tcf_exts_dump use tcf_exts_has_actions helper instead
of exts->nr_actions for checking if there are any actions present.

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

index 287ae6cbf73bf13fd1154de767790db399381d6a..735d556a528318ecc2d12eba7ef6de0a8c945276 100644 (file)
@@ -915,7 +915,7 @@ int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts)
 #ifdef CONFIG_NET_CLS_ACT
        struct nlattr *nest;
 
-       if (exts->action && exts->nr_actions) {
+       if (exts->action && tcf_exts_has_actions(exts)) {
                /*
                 * again for backward compatible mode - we want
                 * to work with both old and new modes of entering