Fix CTRL_ATTR_FAMILY_ID attribute size

This fixes the following kernel error message:
	netlink: 'osmo-ggsn': attribute type 1 has an invalid length.

This is due to CTRL_ATTR_FAMILY_ID being defined as a 16bit netlink
attribute, but us encoding it as u32:
	netlink/genetlink.c:    [CTRL_ATTR_FAMILY_ID]   = { .type = NLA_U16 },

let's properly encode it as 16bit and hence resolve the error message.

Change-Id: I41b2719ffc24d7a3420b5980f2a967264e606d91
Closes: OS#3216
This commit is contained in:
Harald Welte 2018-04-26 21:46:04 +02:00
parent cbcc25b2f0
commit f86d9b40b1
1 changed files with 1 additions and 1 deletions

View File

@ -152,7 +152,7 @@ genl_nlmsg_build_lookup(char *buf, const char *subsys_name)
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, subsys_name);
return nlh;