P2P: Store SSID of the group in p2p_group data
This can be used with P2P management operations that need to verify whether the local device is operating a specific group based on P2P Group ID attribute from a peer. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
aa9bb7644b
commit
6f251b6bb5
6 changed files with 33 additions and 10 deletions
|
@ -540,9 +540,8 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
|
|||
hapd_iface->bss[i]->sta_authorized_cb_ctx = wpa_s;
|
||||
#ifdef CONFIG_P2P
|
||||
hapd_iface->bss[i]->p2p = wpa_s->global->p2p;
|
||||
hapd_iface->bss[i]->p2p_group = wpas_p2p_group_init(
|
||||
wpa_s, ssid->p2p_persistent_group,
|
||||
ssid->mode == WPAS_MODE_P2P_GROUP_FORMATION);
|
||||
hapd_iface->bss[i]->p2p_group = wpas_p2p_group_init(wpa_s,
|
||||
ssid);
|
||||
#endif /* CONFIG_P2P */
|
||||
hapd_iface->bss[i]->setup_complete_cb = wpas_ap_configured_cb;
|
||||
hapd_iface->bss[i]->setup_complete_cb_ctx = wpa_s;
|
||||
|
|
|
@ -3665,8 +3665,7 @@ static void wpas_p2p_idle_update(void *ctx, int idle)
|
|||
|
||||
|
||||
struct p2p_group * wpas_p2p_group_init(struct wpa_supplicant *wpa_s,
|
||||
int persistent_group,
|
||||
int group_formation)
|
||||
struct wpa_ssid *ssid)
|
||||
{
|
||||
struct p2p_group *group;
|
||||
struct p2p_group_config *cfg;
|
||||
|
@ -3680,9 +3679,9 @@ struct p2p_group * wpas_p2p_group_init(struct wpa_supplicant *wpa_s,
|
|||
if (cfg == NULL)
|
||||
return NULL;
|
||||
|
||||
if (persistent_group && wpa_s->conf->persistent_reconnect)
|
||||
if (ssid->p2p_persistent_group && wpa_s->conf->persistent_reconnect)
|
||||
cfg->persistent_group = 2;
|
||||
else if (persistent_group)
|
||||
else if (ssid->p2p_persistent_group)
|
||||
cfg->persistent_group = 1;
|
||||
os_memcpy(cfg->interface_addr, wpa_s->own_addr, ETH_ALEN);
|
||||
if (wpa_s->max_stations &&
|
||||
|
@ -3690,6 +3689,8 @@ struct p2p_group * wpas_p2p_group_init(struct wpa_supplicant *wpa_s,
|
|||
cfg->max_clients = wpa_s->max_stations;
|
||||
else
|
||||
cfg->max_clients = wpa_s->conf->max_num_sta;
|
||||
os_memcpy(cfg->ssid, ssid->ssid, ssid->ssid_len);
|
||||
cfg->ssid_len = ssid->ssid_len;
|
||||
cfg->cb_ctx = wpa_s;
|
||||
cfg->ie_update = wpas_p2p_ie_update;
|
||||
cfg->idle_update = wpas_p2p_idle_update;
|
||||
|
@ -3697,7 +3698,7 @@ struct p2p_group * wpas_p2p_group_init(struct wpa_supplicant *wpa_s,
|
|||
group = p2p_group_init(wpa_s->global->p2p, cfg);
|
||||
if (group == NULL)
|
||||
os_free(cfg);
|
||||
if (!group_formation)
|
||||
if (ssid->mode != WPAS_MODE_P2P_GROUP_FORMATION)
|
||||
p2p_group_notif_formation_done(group);
|
||||
wpa_s->p2p_group = group;
|
||||
return group;
|
||||
|
|
|
@ -32,8 +32,7 @@ int wpas_p2p_group_add_persistent(struct wpa_supplicant *wpa_s,
|
|||
struct wpa_ssid *ssid, int addr_allocated,
|
||||
int freq);
|
||||
struct p2p_group * wpas_p2p_group_init(struct wpa_supplicant *wpa_s,
|
||||
int persistent_group,
|
||||
int group_formation);
|
||||
struct wpa_ssid *ssid);
|
||||
void wpas_p2p_wps_success(struct wpa_supplicant *wpa_s, const u8 *peer_addr,
|
||||
int registrar);
|
||||
enum wpas_p2p_prov_disc_use {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue