* [iproute2 1/1] tipc: change family attribute from u32 to u16
@ 2017-11-15 16:25 Jon Maloy
2017-11-17 0:00 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Jon Maloy @ 2017-11-15 16:25 UTC (permalink / raw)
To: davem, netdev
Cc: mohan.krishna.ghanta.krishnamurthy, tung.q.nguyen, hoang.h.le,
jon.maloy, canh.d.luu, ying.xue, tipc-discussion
commit 28033ae4e0f ("net: netlink: Update attr validation to require
exact length for some types") introduces a stricter control on attributes
of type NLA_U* and NLA_S*.
Since the tipc tool is sending a family attribute of u32 instead of as
expected u16 the tool is now effectively broken.
We fix this by changing the type of the said attribute.
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
---
tipc/msg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tipc/msg.c b/tipc/msg.c
index 22c2222..dc09d05 100644
--- a/tipc/msg.c
+++ b/tipc/msg.c
@@ -125,7 +125,7 @@ static int get_family(void)
genl->cmd = CTRL_CMD_GETFAMILY;
genl->version = 1;
- mnl_attr_put_u32(nlh, CTRL_ATTR_FAMILY_ID, GENL_ID_CTRL);
+ mnl_attr_put_u16(nlh, CTRL_ATTR_FAMILY_ID, GENL_ID_CTRL);
mnl_attr_put_strz(nlh, CTRL_ATTR_FAMILY_NAME, TIPC_GENL_V2_NAME);
if ((err = msg_query(nlh, family_id_cb, &nl_family)))
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [iproute2 1/1] tipc: change family attribute from u32 to u16
2017-11-15 16:25 [iproute2 1/1] tipc: change family attribute from u32 to u16 Jon Maloy
@ 2017-11-17 0:00 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2017-11-17 0:00 UTC (permalink / raw)
To: Jon Maloy
Cc: davem, netdev, mohan.krishna.ghanta.krishnamurthy, tung.q.nguyen,
hoang.h.le, canh.d.luu, ying.xue, tipc-discussion, Jiri Pirko
On Wed, 15 Nov 2017 17:25:44 +0100
Jon Maloy <jon.maloy@ericsson.com> wrote:
> commit 28033ae4e0f ("net: netlink: Update attr validation to require
> exact length for some types") introduces a stricter control on attributes
> of type NLA_U* and NLA_S*.
>
> Since the tipc tool is sending a family attribute of u32 instead of as
> expected u16 the tool is now effectively broken.
>
> We fix this by changing the type of the said attribute.
>
> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Applied.
I noticed devlink has the same problem!
devlink/mnlg.c: mnl_attr_put_u32(nlh, CTRL_ATTR_FAMILY_ID, nlg->id);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-11-17 0:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-15 16:25 [iproute2 1/1] tipc: change family attribute from u32 to u16 Jon Maloy
2017-11-17 0:00 ` Stephen Hemminger
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).