aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-03-01 19:32:33 (GMT)
committerJouni Malinen <j@w1.fi>2013-03-01 19:32:33 (GMT)
commit77e4e85321a0a1255901914d5de916aba050f9e1 (patch)
tree5d08947aba546b5ccb2fc9c1e412f5bce4958924
parentcd1e2309a2ae5bf29d2bbdf798224e1a06feadef (diff)
downloadhostap-77e4e85321a0a1255901914d5de916aba050f9e1.zip
hostap-77e4e85321a0a1255901914d5de916aba050f9e1.tar.gz
hostap-77e4e85321a0a1255901914d5de916aba050f9e1.tar.bz2
P2P: Mark peer authorized for persistent group invitation
When p2p_invite persistent=<id> is used to request a persistent group to be re-invoked, the peer may reply with status=1 (info not yet available) if upper layer processing of the invitiation is requested. The peer is ten expected to start another invitation exchanged within 120 seconds if the user authorizes the connection. Allow this process to be used more easily by automatically authorizing the peer that we tried to invite to use this second invitation sequence even if persistent_reconnect=0. For this mechanism to work, the device that starts the invitation needs to start listen mode to be able to receive the invitation request from the peer. At least for now, this is not done automatically, but future changes could potentially enable this automatically at least if there are no concurrent operations in progress. Example sequence on the initiator: cmd: P2P_INVITE persistent=1 peer=<addr> event: P2P-INVITATION-RESULT status=1 cmd: P2P_LISTEN 120 wait for peer to start another invitiation round.. group will be re-invoked automatically On the peer (with persistent_reconnect=0): event: P2P-INVITATION-RECEIVED sa=<addr> persistent=1 [freq=<MHz>] wait for user approval cmd: P2P_INVITE persistent=1 peer=<addr> group will be re-invoked automatically Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--wpa_supplicant/p2p_supplicant.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 1d5e5f2..4328c07 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -2364,7 +2364,11 @@ static u8 wpas_invitation_process(void *ctx, const u8 *sa, const u8 *bssid,
goto accept_inv;
}
- if (!wpa_s->conf->persistent_reconnect)
+ if (!is_zero_ether_addr(wpa_s->p2p_auth_invite) &&
+ os_memcmp(sa, wpa_s->p2p_auth_invite, ETH_ALEN) == 0) {
+ wpa_printf(MSG_DEBUG, "P2P: Accept previously initiated "
+ "invitation to re-invoke a persistent group");
+ } else if (!wpa_s->conf->persistent_reconnect)
return P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE;
for (s = wpa_s->conf->ssid; s; s = s->next) {
@@ -2506,6 +2510,12 @@ static void wpas_invitation_result(void *ctx, int status, const u8 *bssid,
if (wpa_s->pending_invite_ssid_id == -1)
return; /* Invitation to active group */
+ if (status == P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE) {
+ wpa_printf(MSG_DEBUG, "P2P: Waiting for peer to start another "
+ "invitation exchange to indicate readiness for "
+ "re-invocation");
+ }
+
if (status != P2P_SC_SUCCESS) {
wpas_p2p_remove_pending_group_interface(wpa_s);
return;
@@ -4630,6 +4640,11 @@ int wpas_p2p_invite(struct wpa_supplicant *wpa_s, const u8 *peer_addr,
int force_freq = 0, oper_freq = 0;
int res;
+ if (peer_addr)
+ os_memcpy(wpa_s->p2p_auth_invite, peer_addr, ETH_ALEN);
+ else
+ os_memset(wpa_s->p2p_auth_invite, 0, ETH_ALEN);
+
wpa_s->p2p_persistent_go_freq = freq;
wpa_s->p2p_go_ht40 = !!ht40;
if (ssid->mode == WPAS_MODE_P2P_GO) {