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

Jouni Malinen j at w1.fi
Sun Jul 26 14:29:02 EDT 2015


On Mon, Jul 13, 2015 at 09:49:17AM +0300, Ilan Peer wrote:
> 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.

> diff --git 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);
> +	}

This if block starts with following conditions:
    if (reject == P2P_SC_SUCCESS && p2p->cfg->prov_disc_req) {

> -		if (dev) {
> +	if (dev && reject == P2P_SC_SUCCESS) {

In practice, this looks identical to the previous case since the
p2p->cfg->prov_disc_req callback function is always set.

>  			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);
> -		}
>  	}

I don't see this changing anything in the behavior.. Am I missing
something here?

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list