Fetch IEs from both Beacon and Probe Response frames if available
This allows the driver wrappers to return two sets of IEs, so that the BSS code can use information from both Beacon and Probe Response frames if needed. For example, some Cisco APs seem to include more information in Wireless Provisioning Services IE when it is in the Beacon frame.
This commit is contained in:
parent
94627f6cc8
commit
8c0906542c
4 changed files with 45 additions and 13 deletions
|
@ -120,7 +120,7 @@ static void wpa_bss_add(struct wpa_supplicant *wpa_s,
|
|||
{
|
||||
struct wpa_bss *bss;
|
||||
|
||||
bss = os_zalloc(sizeof(*bss) + res->ie_len);
|
||||
bss = os_zalloc(sizeof(*bss) + res->ie_len + res->beacon_ie_len);
|
||||
if (bss == NULL)
|
||||
return;
|
||||
bss->id = wpa_s->bss_next_id++;
|
||||
|
@ -129,7 +129,8 @@ static void wpa_bss_add(struct wpa_supplicant *wpa_s,
|
|||
os_memcpy(bss->ssid, ssid, ssid_len);
|
||||
bss->ssid_len = ssid_len;
|
||||
bss->ie_len = res->ie_len;
|
||||
os_memcpy(bss + 1, res + 1, res->ie_len);
|
||||
bss->beacon_ie_len = res->beacon_ie_len;
|
||||
os_memcpy(bss + 1, res + 1, res->ie_len + res->beacon_ie_len);
|
||||
|
||||
dl_list_add_tail(&wpa_s->bss, &bss->list);
|
||||
dl_list_add_tail(&wpa_s->bss_id, &bss->list_id);
|
||||
|
@ -273,18 +274,23 @@ static void wpa_bss_update(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
|
|||
wpa_bss_copy_res(bss, res);
|
||||
/* Move the entry to the end of the list */
|
||||
dl_list_del(&bss->list);
|
||||
if (bss->ie_len >= res->ie_len) {
|
||||
os_memcpy(bss + 1, res + 1, res->ie_len);
|
||||
if (bss->ie_len + bss->beacon_ie_len >=
|
||||
res->ie_len + res->beacon_ie_len) {
|
||||
os_memcpy(bss + 1, res + 1, res->ie_len + res->beacon_ie_len);
|
||||
bss->ie_len = res->ie_len;
|
||||
bss->beacon_ie_len = res->beacon_ie_len;
|
||||
} else {
|
||||
struct wpa_bss *nbss;
|
||||
struct dl_list *prev = bss->list_id.prev;
|
||||
dl_list_del(&bss->list_id);
|
||||
nbss = os_realloc(bss, sizeof(*bss) + res->ie_len);
|
||||
nbss = os_realloc(bss, sizeof(*bss) + res->ie_len +
|
||||
res->beacon_ie_len);
|
||||
if (nbss) {
|
||||
bss = nbss;
|
||||
os_memcpy(bss + 1, res + 1, res->ie_len);
|
||||
os_memcpy(bss + 1, res + 1,
|
||||
res->ie_len + res->beacon_ie_len);
|
||||
bss->ie_len = res->ie_len;
|
||||
bss->beacon_ie_len = res->beacon_ie_len;
|
||||
}
|
||||
dl_list_add(prev, &bss->list_id);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,8 @@ struct wpa_scan_res;
|
|||
* @level: signal level
|
||||
* @tsf: Timestamp of last Beacon/Probe Response frame
|
||||
* @last_update: Time of the last update (i.e., Beacon or Probe Response RX)
|
||||
* @ie_len: length of the following IE field in octets
|
||||
* @ie_len: length of the following IE field in octets (from Probe Response)
|
||||
* @beacon_ie_len: length of the following Beacon IE field in octets
|
||||
*
|
||||
* This structure is used to store information about neighboring BSSes in
|
||||
* generic format. It is mainly updated based on scan results from the driver.
|
||||
|
@ -65,7 +66,9 @@ struct wpa_bss {
|
|||
u64 tsf;
|
||||
struct os_time last_update;
|
||||
size_t ie_len;
|
||||
size_t beacon_ie_len;
|
||||
/* followed by ie_len octets of IEs */
|
||||
/* followed by beacon_ie_len octets of IEs */
|
||||
};
|
||||
|
||||
void wpa_bss_update_start(struct wpa_supplicant *wpa_s);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue