wlcore: compare ssid_len before comparing ssids
authorEliad Peller <eliad@wizery.com>
Tue, 15 May 2012 15:31:58 +0000 (18:31 +0300)
committerLuciano Coelho <coelho@ti.com>
Wed, 6 Jun 2012 16:33:28 +0000 (19:33 +0300)
When comparing 2 ssids the ssid_len must be taken
into account. Otherwise, a substring will be treated
as equal.

This bug might cause ssids to get scanned as
public ssids (rather than hidden), resulting in
broadcast probe request (instead of ssid-specific
ones)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/ti/wlcore/scan.c

index 94668d8ba14eca39127cac1b8b9400db84f80280..e1dbe812615ff7ce9aaf026dc7f5647c4b4c3607 100644 (file)
@@ -605,7 +605,9 @@ wl12xx_scan_sched_scan_ssid_list(struct wl1271 *wl,
                                        continue;
 
                                for (j = 0; j < cmd->n_ssids; j++)
-                                       if (!memcmp(req->ssids[i].ssid,
+                                       if ((req->ssids[i].ssid_len ==
+                                            req->ssids[j].ssid_len) &&
+                                           !memcmp(req->ssids[i].ssid,
                                                   cmd->ssids[j].ssid,
                                                   req->ssids[i].ssid_len)) {
                                                cmd->ssids[j].type =