Add user configured vendor IEs to default scan IEs

Add user configured vendor IEs for Probe Request frames to default scan
IEs so that these IEs will be included in the Probe Request frames for
the scans issued also by components other than wpa_supplicant.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Vinita S. Maloo 2020-12-03 20:04:20 +05:30 committed by Jouni Malinen
parent 581dfcc413
commit ea77568d8f
2 changed files with 22 additions and 3 deletions

View file

@ -9784,8 +9784,7 @@ static int wpas_ctrl_vendor_elem_add(struct wpa_supplicant *wpa_s, char *cmd)
if (wpa_s->vendor_elem[frame] == NULL) {
wpa_s->vendor_elem[frame] = buf;
wpas_vendor_elem_update(wpa_s);
return 0;
goto update_ies;
}
if (wpabuf_resize(&wpa_s->vendor_elem[frame], len) < 0) {
@ -9795,8 +9794,14 @@ static int wpas_ctrl_vendor_elem_add(struct wpa_supplicant *wpa_s, char *cmd)
wpabuf_put_buf(wpa_s->vendor_elem[frame], buf);
wpabuf_free(buf);
update_ies:
wpas_vendor_elem_update(wpa_s);
if (frame == VENDOR_ELEM_PROBE_REQ ||
frame == VENDOR_ELEM_PROBE_REQ_P2P)
wpa_supplicant_set_default_scan_ies(wpa_s);
return 0;
}

View file

@ -521,7 +521,7 @@ void wpa_supplicant_set_default_scan_ies(struct wpa_supplicant *wpa_s)
{
struct wpabuf *default_ies = NULL;
u8 ext_capab[18];
int ext_capab_len;
int ext_capab_len, frame_id;
enum wpa_driver_if_type type = WPA_IF_STATION;
#ifdef CONFIG_P2P
@ -545,6 +545,20 @@ void wpa_supplicant_set_default_scan_ies(struct wpa_supplicant *wpa_s)
wpas_mbo_scan_ie(wpa_s, default_ies);
#endif /* CONFIG_MBO */
if (type == WPA_IF_P2P_CLIENT)
frame_id = VENDOR_ELEM_PROBE_REQ_P2P;
else
frame_id = VENDOR_ELEM_PROBE_REQ;
if (wpa_s->vendor_elem[frame_id]) {
size_t len;
len = wpabuf_len(wpa_s->vendor_elem[frame_id]);
if (len > 0 && wpabuf_resize(&default_ies, len) == 0)
wpabuf_put_buf(default_ies,
wpa_s->vendor_elem[frame_id]);
}
if (default_ies)
wpa_drv_set_default_scan_ies(wpa_s, wpabuf_head(default_ies),
wpabuf_len(default_ies));