aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-07-18 21:30:24 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-09 14:17:16 (GMT)
commit9fa243b2953e6d46f2b88775ed466b1a3d650439 (patch)
tree6e63dc5793b55243e73db400f37914c29f38d860 /wpa_supplicant/wps_supplicant.c
parente3768e7c943d97687a8dfc195355995a00981564 (diff)
downloadhostap-9fa243b2953e6d46f2b88775ed466b1a3d650439.zip
hostap-9fa243b2953e6d46f2b88775ed466b1a3d650439.tar.gz
hostap-9fa243b2953e6d46f2b88775ed466b1a3d650439.tar.bz2
P2P: Let WPS code know if it is used in a P2P group
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 5e724c6..0a1c6d6 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -665,13 +665,16 @@ static void wpas_wps_reassoc(struct wpa_supplicant *wpa_s,
}
-int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid)
+int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
+ int p2p_group)
{
struct wpa_ssid *ssid;
wpas_clear_wps(wpa_s);
ssid = wpas_wps_add_network(wpa_s, 0, bssid);
if (ssid == NULL)
return -1;
+ ssid->temporary = 1;
+ ssid->p2p_group = p2p_group;
wpa_config_set(ssid, "phase1", "\"pbc=1\"", 0);
if (wpa_s->wps_fragment_size)
ssid->eap.fragment_size = wpa_s->wps_fragment_size;
@@ -683,7 +686,7 @@ int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid)
int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
- const char *pin)
+ const char *pin, int p2p_group)
{
struct wpa_ssid *ssid;
char val[128];
@@ -693,6 +696,8 @@ int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
ssid = wpas_wps_add_network(wpa_s, 0, bssid);
if (ssid == NULL)
return -1;
+ ssid->temporary = 1;
+ ssid->p2p_group = p2p_group;
if (pin)
os_snprintf(val, sizeof(val), "\"pin=%s\"", pin);
else {
@@ -751,7 +756,7 @@ int wpas_wps_start_oob(struct wpa_supplicant *wpa_s, char *device_type,
if ((wps->oob_conf.oob_method == OOB_METHOD_DEV_PWD_E ||
wps->oob_conf.oob_method == OOB_METHOD_DEV_PWD_R) &&
wpas_wps_start_pin(wpa_s, NULL,
- wpabuf_head(wps->oob_conf.dev_password)) < 0)
+ wpabuf_head(wps->oob_conf.dev_password), 0) < 0)
return -1;
return 0;