P2PS: Send follow-on PD response only if status is 12
authorMax Stepanov <Max.Stepanov@intel.com>
Thu, 24 Sep 2015 17:37:54 +0000 (20:37 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 7 Oct 2015 14:07:21 +0000 (17:07 +0300)
commitf94e4c20e4d09aa61be77b7f9707e70dd8e21744
treefd2d027f53abc8549c36a4828f5647886c1539a0
parent9773ea38cfaee64ddadad990970702144fba5890
P2PS: Send follow-on PD response only if status is 12

When a follow-on PD request is received, peer should not send a
follow-on PD response except the case when the PD request status value
is 12 (Success: accepted by user). Previously, the wpa_supplicant
implementation behaved differently sending the follow-on PD Response on
any follow-on PD Request.

Fix the issue by adding the following changes:

1. Don't send PD Response if the follow-on PD Request status is
   different than 12 (seeker side).
2. Don't wait for the follow-on PD Response if the follow-on PD
   Request was sent with the status different than 12 (advertiser
   side).
3. If the follow-on PD Request was sent with the status different
   than 12 use the follow-on PD Request ACK as PD completion event
   (advertiser side).
4. Notify ASP about the PD completion by sending P2PS-PROV-DONE with
   the PD Request status (advertiser side).

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
src/p2p/p2p.c
src/p2p/p2p_pd.c