From: Eliad Peller Date: Sun, 1 Apr 2012 18:49:03 +0000 (+0300) Subject: P2P: Notify about disconnection only when needed X-Git-Tag: hostap_2_0~769 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbe7aa222510c6f02e7813cc6ea0cdf84d3fec9c;p=thirdparty%2Fhostap.git 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 intended-for: hostap-1 --- diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c index 6e84dc06b..d471dfb16 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 */