diff mbox

[net-next,V2,1/6] net/sched: cls_matchall: Dump skip flags

Message ID 1487082640-24813-2-git-send-email-ogerlitz@mellanox.com
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Or Gerlitz Feb. 14, 2017, 2:30 p.m. UTC
The skip flags are not dumped to user-space, do that.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Yotam Gigi <yotamg@mellanox.com>
---
 net/sched/cls_matchall.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jakub Kicinski Feb. 14, 2017, 7:28 p.m. UTC | #1
On Tue, 14 Feb 2017 16:30:35 +0200, Or Gerlitz wrote:
> The skip flags are not dumped to user-space, do that.
> 
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> Acked-by: Jiri Pirko <jiri@mellanox.com>
> Acked-by: Yotam Gigi <yotamg@mellanox.com>
> ---
>  net/sched/cls_matchall.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
> index f2141cb..ce2f7d4 100644
> --- a/net/sched/cls_matchall.c
> +++ b/net/sched/cls_matchall.c
> @@ -244,6 +244,8 @@ static int mall_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
>  	    nla_put_u32(skb, TCA_MATCHALL_CLASSID, head->res.classid))
>  		goto nla_put_failure;
>  
> +	nla_put_u32(skb, TCA_MATCHALL_FLAGS, head->flags);
> +

Shouldn't the return status from nla_put_u32() be checked?
Or Gerlitz Feb. 15, 2017, 8:20 a.m. UTC | #2
On Tue, Feb 14, 2017 at 9:28 PM, Jakub Kicinski <kubakici@wp.pl> wrote:
> On Tue, 14 Feb 2017 16:30:35 +0200, Or Gerlitz wrote:
>> The skip flags are not dumped to user-space, do that.
>>
>> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
>> Acked-by: Jiri Pirko <jiri@mellanox.com>
>> Acked-by: Yotam Gigi <yotamg@mellanox.com>
>> ---
>>  net/sched/cls_matchall.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
>> index f2141cb..ce2f7d4 100644
>> --- a/net/sched/cls_matchall.c
>> +++ b/net/sched/cls_matchall.c
>> @@ -244,6 +244,8 @@ static int mall_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
>>           nla_put_u32(skb, TCA_MATCHALL_CLASSID, head->res.classid))
>>               goto nla_put_failure;
>>
>> +     nla_put_u32(skb, TCA_MATCHALL_FLAGS, head->flags);
>> +
>
> Shouldn't the return status from nla_put_u32() be checked?

Yeah, amazing how the developer (me) and three internal reviewers
missed that :(, thanks!

Or.
diff mbox

Patch

diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
index f2141cb..ce2f7d4 100644
--- a/net/sched/cls_matchall.c
+++ b/net/sched/cls_matchall.c
@@ -244,6 +244,8 @@  static int mall_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
 	    nla_put_u32(skb, TCA_MATCHALL_CLASSID, head->res.classid))
 		goto nla_put_failure;
 
+	nla_put_u32(skb, TCA_MATCHALL_FLAGS, head->flags);
+
 	if (tcf_exts_dump(skb, &head->exts))
 		goto nla_put_failure;