3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-05 19:49:23 +01:00

scan: fixed flush flag parsing

Parsing the flush flag for external scans was not done correctly
as it was not parsing the ATTR_SCAN_FLAGS but instead the flag
bitmap. Fix this by parsing the flags attribute, then checking if
the bit is set.
This commit is contained in:
James Prestwood 2024-06-18 09:58:50 -07:00 committed by Denis Kenzior
parent 88a71eca72
commit 43d5e89fac

View File

@ -2021,16 +2021,14 @@ static struct scan_context *scan_context_new(uint64_t wdev_id)
static bool scan_parse_flush_flag_from_msg(struct l_genl_msg *msg)
{
struct l_genl_attr attr;
uint16_t type, len;
const void *data;
uint32_t flags;
if (!l_genl_attr_init(&attr, msg))
if (nl80211_parse_attrs(msg, NL80211_ATTR_SCAN_FLAGS, &flags,
NL80211_ATTR_UNSPEC) < 0)
return false;
while (l_genl_attr_next(&attr, &type, &len, &data))
if (type == NL80211_SCAN_FLAG_FLUSH)
return true;
if (flags & NL80211_SCAN_FLAG_FLUSH)
return true;
return false;
}