]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Do not set sched_scan filter if driver does not support it
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 25 Nov 2011 15:46:00 +0000 (17:46 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 25 Nov 2011 15:46:00 +0000 (17:46 +0200)
cfg80211 will reject the NL80211_CMD_START_SCHED_SCAN if too many
match sets are requested. To avoid being completely unable to start
any scheduled scans, skip setting these filters if the driver did
not advertise support for large enough number of match sets.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/drivers/driver_nl80211.c

index 4bbac1bb0973cae65806a40aa7e17c63de8cda51..8f83e8e7af2049553f30c10005a9d118781c9894 100644 (file)
@@ -2798,7 +2798,8 @@ static int wpa_driver_nl80211_sched_scan(void *priv,
 
        NLA_PUT_U32(msg, NL80211_ATTR_SCHED_SCAN_INTERVAL, interval);
 
-       if (drv->num_filter_ssids) {
+       if (drv->num_filter_ssids &&
+           (int) drv->num_filter_ssids <= drv->capa.max_match_sets) {
                match_sets = nlmsg_alloc();
 
                for (i = 0; i < drv->num_filter_ssids; i++) {