P2P: Allow WPS_PBC command on GO to select on P2P Device Address
[mech_eap.git] / src / eap_server / eap_server_wsc.c
index 83e55d9..e944a4d 100644 (file)
@@ -18,6 +18,7 @@
 #include "eloop.h"
 #include "eap_i.h"
 #include "eap_common/eap_wsc_common.h"
+#include "p2p/p2p.h"
 #include "wps/wps.h"
 
 
@@ -135,11 +136,14 @@ static void * eap_wsc_init(struct eap_sm *sm)
        }
        cfg.assoc_wps_ie = sm->assoc_wps_ie;
        cfg.peer_addr = sm->peer_addr;
+#ifdef CONFIG_P2P
        if (sm->assoc_p2p_ie) {
                wpa_printf(MSG_DEBUG, "EAP-WSC: Prefer PSK format for P2P "
                           "client");
                cfg.use_psk_key = 1;
+               cfg.p2p_dev_addr = p2p_get_go_dev_addr(sm->assoc_p2p_ie);
        }
+#endif /* CONFIG_P2P */
        data->wps = wps_init(&cfg);
        if (data->wps == NULL) {
                os_free(data);