diff mbox

P2P: notify about disconnection only when needed

Message ID 1330956111-14870-1-git-send-email-eliad@wizery.com
State Accepted
Commit dbe7aa222510c6f02e7813cc6ea0cdf84d3fec9c
Headers show

Commit Message

Eliad Peller March 5, 2012, 2:01 p.m. UTC
wpas_notify_state_changed() notifies about disconnection
when new_state < WPA_ASSOCIATED, without checking the
old state. This finally might fire the p2p idle group
timer during the connection attempt.

Signed-hostap: Eliad Peller <eliad@wizery.com>
intended-for: hostap-1
---
 wpa_supplicant/notify.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Jouni Malinen April 1, 2012, 6:52 p.m. UTC | #1
On Mon, Mar 05, 2012 at 04:01:51PM +0200, Eliad Peller wrote:
> wpas_notify_state_changed() notifies about disconnection
> when new_state < WPA_ASSOCIATED, without checking the
> old state. This finally might fire the p2p idle group
> timer during the connection attempt.

Thanks, applied. Though, I think that some other commits have already
addressed that P2P idle group issue, so this is now more to avoid extra
processing than fix any noticeable issue.
diff mbox

Patch

diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index da98a14..8d9b669 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -82,7 +82,7 @@  void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
 #ifdef CONFIG_P2P
 	if (new_state == WPA_COMPLETED)
 		wpas_p2p_notif_connected(wpa_s);
-	else if (new_state < WPA_ASSOCIATED)
+	else if (old_state >= WPA_ASSOCIATED && new_state < WPA_ASSOCIATED)
 		wpas_p2p_notif_disconnected(wpa_s);
 #endif /* CONFIG_P2P */