[PATCH 1/1] NL80211: checking for ifidx in survey handler

shital jaju shital1391 at gmail.com
Tue Jan 28 00:44:57 EST 2014


This checks if attribute ifidx is present,
before trying to get the value of interface index.

Signed-hostap: Shital Jaju <shitalj at broadcom.com>
---
 src/drivers/driver_nl80211.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index b5bf368..1d3c663 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -10552,7 +10552,10 @@ static int survey_handler(struct nl_msg *msg, void
*arg)
        nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
                  genlmsg_attrlen(gnlh, 0), NULL);

-       ifidx = nla_get_u32(tb[NL80211_ATTR_IFINDEX]);
+       if (tb[NL80211_ATTR_IFINDEX])
+               ifidx = nla_get_u32(tb[NL80211_ATTR_IFINDEX]);
+       else
+               return NL_SKIP;

        if (!tb[NL80211_ATTR_SURVEY_INFO])
                return NL_SKIP;
--
1.7.9.5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.shmoo.com/pipermail/hostap/attachments/20140128/f9d23ac4/attachment.htm>


More information about the HostAP mailing list