All of lore.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
	Roi Dayan <roid@mellanox.com>,
	netdev@vger.kernel.org, Or Gerlitz <ogerlitz@mellanox.com>
Subject: [PATCH net-next V4 1/7] net/sched: cls_flower: Properly handle classifier flags dumping
Date: Thu, 16 Feb 2017 10:31:10 +0200	[thread overview]
Message-ID: <1487233876-28576-2-git-send-email-ogerlitz@mellanox.com> (raw)
In-Reply-To: <1487233876-28576-1-git-send-email-ogerlitz@mellanox.com>

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>
---
 net/sched/cls_flower.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 0826c8e..850d982 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;
-- 
2.5.5

  reply	other threads:[~2017-02-16  8:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16  8:31 [PATCH net-next V4 0/7] net/sched: Reflect HW offload status in classifiers Or Gerlitz
2017-02-16  8:31 ` Or Gerlitz [this message]
2017-02-16  8:31 ` [PATCH net-next V4 2/7] net/sched: cls_matchall: Dump the classifier flags Or Gerlitz
2017-02-16  8:31 ` [PATCH net-next V4 3/7] net/sched: Reflect HW offload status Or Gerlitz
2017-02-16  8:31 ` [PATCH net-next V4 4/7] net/sched: cls_flower: " Or Gerlitz
2017-02-16  8:31 ` [PATCH net-next V4 5/7] net/sched: cls_matchall: Reflect HW offloading status Or Gerlitz
2017-02-16  8:31 ` [PATCH net-next V4 6/7] net/sched: cls_u32: Reflect HW offload status Or Gerlitz
2017-02-16  8:31 ` [PATCH net-next V4 7/7] net/sched: cls_bpf: " Or Gerlitz
2017-02-17 17:08 ` [PATCH net-next V4 0/7] net/sched: Reflect HW offload status in classifiers David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487233876-28576-2-git-send-email-ogerlitz@mellanox.com \
    --to=ogerlitz@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=roid@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.