[PATCH] Add an option to suppress provision discovery during P2P Join

Jouni Malinen j
Mon Nov 21 08:50:19 PST 2011

On Mon, Nov 21, 2011 at 02:54:27AM -0800, Jithu Jance wrote:
> This patch adds an option to suppress provision discovery req during P2P Join. This is required in scenarios where a P2P client is connecting to a P2P GO that supports only PIN DISPLAY option. 
> The client side has to use the PIN displayed by the GO and we can't issue a p2p_connect on the client side till the PIN is known(since pin has to be entered along with p2p_connect command).
> so in this case, we have to issue an explicit Provision Discovery before issuing connect command so that the GO can display its PIN and we can use the displayed pin in the subsequent p2p_connect command. 
> Since we have already done the PD, the "p2p_connect join" command shouldn't initiate another provision discovery.

This looks somewhat problematic and would likely not comply with the P2P
specification requirements. How are you sending the Provision Discovery
Request prior to p2p_connect join command? Please note that the Group ID
attribute is added only in the p2p_connect join case and as such, a
separate p2p_prov_disc command prior to p2p_connect would not actually
send correct Provision Discovery Request frame.

> Also, Please share your thoughts on adding an extra "no_pd" argument to p2p_connect command. 

That approach would be quite a bit easier to understand while I have
problems figuring out why this patch is adding a new configuration
parameter for unconditionally dropping the Provision Discovery prior to
joining a group.

I think this functionality would likely require an extension to
p2p_prov_disc command to allow it to specify which group is being used
(without this, Provision Discovery Request is for the purpose of forming
a new group; not for joining an existing group). With that added, it
should be easy to handle the rest automatically, i.e., p2p_connect join
should figure out whether to send Provision Discovery Request based on
whether p2p_prov_disc was used prior to it with the new parameter to
indicate which P2P group to target with the Provision Discovery Request.

> diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
> @@ -763,6 +763,7 @@ static void wpas_p2p_clone_config(struct wpa_supplicant *dst,
> @@ -2503,6 +2504,17 @@ static void wpas_p2p_scan_res_join(struct wpa_supplicant *wpa_s,
>  			break;
>  		}
> +		if (wpa_s->conf->p2p_suppress_pd) {
> +			/* If Provision Discovery is suppressed,
> +			 * Start join operation immediately. The Provision
> +			 * discovery in this case would have been explicitly
> +			 * initiated before the p2p_connect command.
> +			 */
> +			wpa_printf(MSG_DEBUG, "P2P: Provision "
> +				"Discovery Request from Join context suppressed");
> +			goto start;
> +		}

This does not look correct. P2P specification requires the Provision
Discovery Request to be sent prior to joining a running group. I see no
point in having a global configuration option for doing this. It would
be way too easy to result in non-compliant behavior with this.

If this Provision Discovery Request needs to be skipped, the decision to
do show better be conditional on a prior operation. In other words, this
could either be done automatically based on an earlier Provision
Discovery operation having been executed recently with the target GO or
at least based on a parameter to p2p_connect.

As a side note, this place to skip the p2p_prov_disc_req() call does not
look correct. pending_pd_before_join should not be set in that case (nor
is there much point in printing the debug message claiming that the
Provision Discovery Request is to be sent if that part is skipped).

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list