]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tipc: change family attribute from u32 to u16
authorJon Maloy <jon.maloy@ericsson.com>
Wed, 15 Nov 2017 16:25:44 +0000 (17:25 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 16 Nov 2017 23:58:48 +0000 (15:58 -0800)
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

index 22c22226bb205b8a8144f3c041fff9955a17ac41..dc09d05048f3703ea68e2b83945b001a2a9b7e3b 100644 (file)
@@ -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)))