The dedicated wifi interface is not properly reseted. So even if the
disconnection went fine, it might still stay on a connecting state in
the wifi plugin only.
---
 plugins/wifi.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index 4be1d16..5f2ebf1 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -218,10 +218,15 @@ static void peer_cancel_timeout(struct wifi_data *wifi)
 {
        if (wifi->p2p_connection_timeout > 0)
                g_source_remove(wifi->p2p_connection_timeout);
+
        wifi->p2p_connection_timeout = 0;
        wifi->p2p_connecting = false;
-       connman_peer_unref(wifi->pending_peer);
-       wifi->pending_peer = NULL;
+
+       if (wifi->pending_peer) {
+               connman_peer_unref(wifi->pending_peer);
+               wifi->pending_peer = NULL;
+       }
+
        wifi->peer = NULL;
 }
 
@@ -367,6 +372,9 @@ static int peer_disconnect(struct connman_peer *peer)
                                                        &peer_params);
        g_free(peer_params.path);
 
+       if (ret == -EINPROGRESS)
+               peer_cancel_timeout(wifi);
+
        return ret;
 }
 
-- 
1.8.5.5

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to