]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Notify about disconnection only when needed
authorEliad Peller <eliad@wizery.com>
Sun, 1 Apr 2012 18:49:03 +0000 (21:49 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 1 Apr 2012 18:49:03 +0000 (21:49 +0300)
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

wpa_supplicant/notify.c

index 6e84dc06b55057194c56d84c0960a1ccef902edc..d471dfb16f84abb8e264e253c9002b8d227c3cc8 100644 (file)
@@ -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 */