P2P: Clear old P2PS provision data

Receiving a provision discovery request for an ASP service that
has auto accept set to false should result in a provision discovery
response with the status field set to "currently unavailable".
Having stale P2PS provision data, results in sending a response with
the status set to success because it is mistakenly referred to as the
follow-on provision discovery request.

Fix that by clearing stale P2PS provision data in the following cases:
 1. When provision discovery is complete
 2. When ASP services are flushed (in which case old ASP provisioning
    is no longer valid).

Signed-off-by: Avrahams Stern <avraham.stern@intel.com>
This commit is contained in:
Avrahams Stern 2016-10-18 12:44:16 +03:00 committed by Jouni Malinen
parent f69939ede8
commit 78a3b23060
2 changed files with 4 additions and 0 deletions

View file

@ -2822,6 +2822,7 @@ void p2p_service_flush_asp(struct p2p_data *p2p)
}
p2p->p2ps_adv_list = NULL;
p2ps_prov_free(p2p);
p2p_dbg(p2p, "All ASP advertisements flushed");
}

View file

@ -1163,6 +1163,9 @@ out:
msg.group_id, msg.group_id_len);
}
if (reject != P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE)
p2ps_prov_free(p2p);
if (reject == P2P_SC_SUCCESS) {
switch (config_methods) {
case WPS_CONFIG_DISPLAY: