libnl_2: Fix getting family_id
Change-Id: I27b2495fb96852e960f647f032a5fcd446ec742b
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/libnl_2/genl/genl.c b/libnl_2/genl/genl.c
index dd20717..2442993 100644
--- a/libnl_2/genl/genl.c
+++ b/libnl_2/genl/genl.c
@@ -112,6 +112,7 @@
nlmhdr.nlmsg_pid = sock->s_local.nl_pid;
/* Generic netlink header */
+ memset(&gmhhdr, 0, sizeof(gmhhdr));
gmhhdr.cmd = CTRL_CMD_GETFAMILY;
gmhhdr.version = CTRL_ATTR_FAMILY_ID;
@@ -221,9 +222,11 @@
/* Save the family id */
else if (nl80211_flag &&
- nla->nla_type == CTRL_ATTR_FAMILY_ID)
- nl80211_genl_id = \
+ nla->nla_type == CTRL_ATTR_FAMILY_ID) {
+ nl80211_genl_id =
*((int *)nla_data(nla));
+ nl80211_flag = 0;
+ }
}