aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/notify.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2012-04-01 18:49:03 (GMT)
committerJouni Malinen <j@w1.fi>2012-04-01 18:49:03 (GMT)
commitdbe7aa222510c6f02e7813cc6ea0cdf84d3fec9c (patch)
tree6eac7660b277c2fdda101bff23bbc69879686b1d /wpa_supplicant/notify.c
parent3c29244eb7a2dfd62d80ba4e6176de2889a5dca4 (diff)
downloadhostap-dbe7aa222510c6f02e7813cc6ea0cdf84d3fec9c.zip
hostap-dbe7aa222510c6f02e7813cc6ea0cdf84d3fec9c.tar.gz
hostap-dbe7aa222510c6f02e7813cc6ea0cdf84d3fec9c.tar.bz2
P2P: Notify about disconnection only when needed
wpas_notify_state_changed() notified about disconnection when new_state < WPA_ASSOCIATED, without checking the old state. This results in extra processing which can be avoided by checking that old_state was connected. Signed-hostap: Eliad Peller <eliad@wizery.com> intended-for: hostap-1
Diffstat (limited to 'wpa_supplicant/notify.c')
-rw-r--r--wpa_supplicant/notify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index 6e84dc0..d471dfb 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 */