]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
net/sched: cls_flower: Properly handle classifier flags dumping
authorOr Gerlitz <ogerlitz@mellanox.com>
Thu, 16 Feb 2017 08:31:10 +0000 (10:31 +0200)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 1 Mar 2017 13:55:48 +0000 (06:55 -0700)
BugLink: http://bugs.launchpad.net/bugs/1668019
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>
(cherry picked from commit 749e6720d2ee10d5221d5d7b8cee8ac5d1cd690e)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
net/sched/cls_flower.c

index a9a37907e7be37b1f103a9b5bb3e8fbb223063a3..df4293ee3c6cd552896435394ef7429193edb0ba 100644 (file)
@@ -1164,7 +1164,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;