netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net] sched: act: count in the size of action flags bitfield
@ 2020-02-25 12:54 Jiri Pirko
  2020-02-27  1:11 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Pirko @ 2020-02-25 12:54 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, jhs, xiyou.wangcong, vladbu, mlxsw

From: Jiri Pirko <jiri@mellanox.com>

The put of the flags was added by the commit referenced in fixes tag,
however the size of the message was not extended accordingly.

Fix this by adding size of the flags bitfield to the message size.

Fixes: e38226786022 ("net: sched: update action implementations to support flags")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 net/sched/act_api.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 90a31b15585f..8c466a712cda 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -186,6 +186,7 @@ static size_t tcf_action_shared_attrs_size(const struct tc_action *act)
 		+ nla_total_size(IFNAMSIZ) /* TCA_ACT_KIND */
 		+ cookie_len /* TCA_ACT_COOKIE */
 		+ nla_total_size(0) /* TCA_ACT_STATS nested */
+		+ nla_total_size(sizeof(struct nla_bitfield32)) /* TCA_ACT_FLAGS */
 		/* TCA_STATS_BASIC */
 		+ nla_total_size_64bit(sizeof(struct gnet_stats_basic))
 		/* TCA_STATS_PKT64 */
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch net] sched: act: count in the size of action flags bitfield
  2020-02-25 12:54 [patch net] sched: act: count in the size of action flags bitfield Jiri Pirko
@ 2020-02-27  1:11 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-02-27  1:11 UTC (permalink / raw)
  To: jiri; +Cc: netdev, kuba, jhs, xiyou.wangcong, vladbu, mlxsw

From: Jiri Pirko <jiri@resnulli.us>
Date: Tue, 25 Feb 2020 13:54:12 +0100

> From: Jiri Pirko <jiri@mellanox.com>
> 
> The put of the flags was added by the commit referenced in fixes tag,
> however the size of the message was not extended accordingly.
> 
> Fix this by adding size of the flags bitfield to the message size.
> 
> Fixes: e38226786022 ("net: sched: update action implementations to support flags")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Applied and queued up for v5.5 -stable, thanks Jiri.

This is a common mistake which is made when adding new attributes, so it would
be nice if there were a programmatic way to make sure these adjustments never
get forgotten.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-27  1:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 12:54 [patch net] sched: act: count in the size of action flags bitfield Jiri Pirko
2020-02-27  1:11 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).