[PATCH] Add an option to suppress provision discovery during P2P Join
Jouni Malinen
j
Tue Nov 22 07:05:30 PST 2011
On Tue, Nov 22, 2011 at 03:10:57AM -0800, Jithu Jance wrote:
> Consider a scenario where a P2P client wants to Join P2P GO whose wps config method is
> advertised as DISPLAY.
>
> In this case, I think we have to use explicit provision discovery before issuing
> p2p_connect. The explicit discovery is used to retreive the PIN from GO side.
Well, this depends on the GO implementation. Some GO devices may have a
PIN displayed somehow all the time. Anyway, yes, there may be cases
where a Provision Discovery request may be needed.
> Device A (P2P Client) Device B (P2P GO with PIN DISPLAY)
> -------------------------------------------------------------------------------------------
> p2p_find
>
> P2p_prov_disc <GO_DEV_ADDRESS> display
>
> PROV_DISC_SHOW_PIN EVENT >>> DISPLAY GO's PIN
This is not correct. The Provision Discovery Request sent by
p2p_prov_disc is for the purpose of starting group formation while you
are trying to get the already running GO to display a PIN. The
difference is in whether the Group Id attribute is included in the
message (it needs to be included for this join-a-group case, but that
p2p_prov_disc command does not add it).
> p2p_connect <GO_DEV_ADDR> <GO_PIN> join
> [since we have already done the PD, I think we shouldn't repeat it.
> Otherwise the GO may regenerate the PIN on receipt of prov disc request.]
If the previous step had actually sent a Provision Discovery Request
with Group Id attribute, I would agree with this. However, it didn't and
as such, leaving out the correct frame here would result in incorrect
behavior. Anyway, the proper way to address this is to extend
p2p_prov_disc behavior
> The command that I have used is p2p_prov_disc <go_dev_addr> <req_config_method>
> The prov disc req is sent from Client's p2p_device address interface. The group id
> will only be created on the subsequent p2p_connect command. Is group id really
> required in this scenario??. Correct me, if my understanding is wrong.
Yes, the Group Id is required in Provision Discovery Request that is
sent prior to joining a running group. Since the group is already
running, the Group Id is known and no new Group Id gets created with
p2p_connect. If you were talking about forming a new group, the Group Id
would indeed be known only after the p2p_connect (and GO Negotiation).
> Agree with you. The sending of provision discovery should be based on the availablity of provisioning info.
> But, if we store the provisioning info, when should it be cleared/reset?? Is it safe to assume that the
> provisioning info received for a particular GO will hold good till there is a change in advertised Config methods
> or till DEVICE_LOST event??
For this particular case of joining a running group, I think it would be
fine to store the information when the extended p2p_prov_disc command is
used and that could then be used on the following p2p_connect join
operation. In theory, there could be some kind of time limit added to
clear the configuration (e.g., the 2 minute WPS walk time), but other
than that, I don't see any particular need for additional clearing of
this information.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list