summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2017-02-16 10:31:10 +0200
committerDavid S. Miller <davem@davemloft.net>2017-02-17 12:08:04 -0500
commit749e6720d2ee10d5221d5d7b8cee8ac5d1cd690e (patch)
tree314c0c784493090ebf512710f086433d9fd36e2b
parentad8e963ca6838071dd2f3db2df66b247b99f4295 (diff)
downloadlinux-749e6720d2ee10d5221d5d7b8cee8ac5d1cd690e.tar.bz2
net/sched: cls_flower: Properly handle classifier flags dumping
Dump the classifier flags only if non zero and make sure to check the return status of the handler that puts them into the netlink msg. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sched/cls_flower.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 0826c8ec3a76..850d98294bf6 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -1229,7 +1229,8 @@ static int fl_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
if (fl_dump_key_flags(skb, key->control.flags, mask->control.flags))
goto nla_put_failure;
- nla_put_u32(skb, TCA_FLOWER_FLAGS, f->flags);
+ if (f->flags && nla_put_u32(skb, TCA_FLOWER_FLAGS, f->flags))
+ goto nla_put_failure;
if (tcf_exts_dump(skb, &f->exts))
goto nla_put_failure;