[PATCH] libgtpnl[master]: Fix CTRL_ATTR_FAMILY_ID attribute size

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Apr 26 19:51:48 UTC 2018


Review at  https://gerrit.osmocom.org/7939

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
---
M src/genl.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libgtpnl refs/changes/39/7939/1

diff --git a/src/genl.c b/src/genl.c
index f534221..5d8b9af 100644
--- a/src/genl.c
+++ b/src/genl.c
@@ -152,7 +152,7 @@
 	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, subsys_name);
 
 	return nlh;

-- 
To view, visit https://gerrit.osmocom.org/7939
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41b2719ffc24d7a3420b5980f2a967264e606d91
Gerrit-PatchSet: 1
Gerrit-Project: libgtpnl
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list