[PATCH 11/11] P2PS: Save correctly WPS prov. info and intended address on PD req

Ilan Peer ilan.peer at intel.com
Mon Jul 13 02:49:17 EDT 2015


From: Andrei Otcheretianski <andrei.otcheretianski at intel.com>

When PD request is answered with a success status, WPS provisioning info and
intended address (if provided) should be stored for this peer.
This wasn't done for the case when P2PS method is used, which potentially
resulted in a redundant legacy PD flow with this peer.
Fix this by saving all the required info if the status is SUCCESS.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
Reviewed-by: Ilan Peer <ilan.peer at intel.com>
---
 src/p2p/p2p_pd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
index 2497236..c1bfaf7 100644
--- a/src/p2p/p2p_pd.c
+++ b/src/p2p/p2p_pd.c
@@ -831,8 +831,9 @@ out:
 					msg.capability ? msg.capability[1] :
 					0,
 					msg.group_id, msg.group_id_len);
+	}
 
-		if (dev) {
+	if (dev && reject == P2P_SC_SUCCESS) {
 			switch (config_methods) {
 			case WPS_CONFIG_DISPLAY:
 				dev->wps_prov_info = WPS_CONFIG_KEYPAD;
@@ -854,7 +855,6 @@ out:
 			if (msg.intended_addr)
 				os_memcpy(dev->interface_addr,
 					  msg.intended_addr, ETH_ALEN);
-		}
 	}
 	p2p_parse_free(&msg);
 }
-- 
1.9.1



More information about the HostAP mailing list