mac80211: Support a scan request for a specific BSSID
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 26 Feb 2016 20:12:48 +0000 (22:12 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 5 Apr 2016 08:56:28 +0000 (10:56 +0200)
If the cfg80211 scan trigger operation specifies a single BSSID, use
that value instead of the wildcard BSSID in the Probe Request frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/scan.c

index a3fea1f35ef9dc747d0339fd831c06fac8082d4e..41aa728e54686518039f9fd78b9bd177baf10a71 100644 (file)
@@ -305,6 +305,7 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local)
        ether_addr_copy(local->hw_scan_req->req.mac_addr, req->mac_addr);
        ether_addr_copy(local->hw_scan_req->req.mac_addr_mask,
                        req->mac_addr_mask);
+       ether_addr_copy(local->hw_scan_req->req.bssid, req->bssid);
 
        return true;
 }
@@ -499,7 +500,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
 
        for (i = 0; i < scan_req->n_ssids; i++)
                ieee80211_send_probe_req(
-                       sdata, local->scan_addr, NULL,
+                       sdata, local->scan_addr, scan_req->bssid,
                        scan_req->ssids[i].ssid, scan_req->ssids[i].ssid_len,
                        scan_req->ie, scan_req->ie_len,
                        scan_req->rates[band], false,
@@ -564,6 +565,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
                        req->n_channels * sizeof(req->channels[0]);
                local->hw_scan_req->req.ie = ies;
                local->hw_scan_req->req.flags = req->flags;
+               eth_broadcast_addr(local->hw_scan_req->req.bssid);
 
                local->hw_scan_band = 0;