commit 43d5e89fac9baaed1d1ad81b880ead74c7315b2b
parent 88a71eca7204b67e0f3133089e48549ec8bb5202
Author: James Prestwood <prestwoj@gmail.com>
Date: Tue, 18 Jun 2024 09:58:50 -0700
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.
Diffstat:
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/scan.c b/src/scan.c
@@ -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;
}