Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. [PATCH 0/3] wifi: p2p: Improvements on p2p and peer handling
      (John Ernberg)
   2. [PATCH 1/3] wifi: p2p: Fix several unref of NULL pointer.
      (John Ernberg)
   3. [PATCH 2/3] wifi: p2p: Fix conditional for p2p driver
      unregister. (John Ernberg)
   4. [PATCH 3/3] wifi: p2p: Remove peers when technology is
      disabled. (John Ernberg)
   5. Re: [PATCH 2/3] wifi: p2p: Fix conditional for p2p driver
      unregister. (Tomasz Bursztyka)
   6. Re: [PATCH 1/3] wifi: p2p: Fix several unref of NULL pointer.
      (Tomasz Bursztyka)
   7. Re: [PATCH 3/3] wifi: p2p: Remove peers when technology is
      disabled. (Tomasz Bursztyka)


----------------------------------------------------------------------

Message: 1
Date: Wed, 16 Dec 2015 12:15:51 +0000
From: John Ernberg <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [PATCH 0/3] wifi: p2p: Improvements on p2p and peer handling
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

From: John Ernberg <[email protected]>

Hi,

Here is a set of patches that improves the stability of the p2p and peer
handling in the wifi plugin.

A couple of extra comments about the patches themselves:
0001 - 2 unref guards were omitted here and placed in patch 0003,
this to remove a dependency between patches.
0002 - This conditional just looked plain wrong to me, if it's actually
correct as it is, just drop this patch. I have not noticed any regressions
from this change.
0003 - See the note on patch 0001.

I am not sure if the patches present the best approach in dealing with the
issues, so please take this into extra consideration while reviewing the
patch-set. Thank you.

Best regards // John Ernberg

John Ernberg (3):
  wifi: p2p: Fix several unref of NULL pointer.
  wifi: p2p: Fix conditional for p2p driver unregister.
  wifi: p2p: Remove peers when technology is disabled.

 plugins/wifi.c | 114 +++++++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 83 insertions(+), 31 deletions(-)

-- 
1.9.1


------------------------------

Message: 2
Date: Wed, 16 Dec 2015 12:15:51 +0000
From: John Ernberg <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [PATCH 1/3] wifi: p2p: Fix several unref of NULL pointer.
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

From: John Ernberg <[email protected]>

When a Wi-Fi dongle would be removed from the system or if wpa_supplicant
would send a system_killed signal it's possible that the wifi plugin is
destroyed before gsupplicant has reached a state where it will no longer
call any callbacks.
This would result in various SIGSEGV abortions by unref of NULL pointer.

The changes to the p2p scanning were copied from wifi scanning.
---
 plugins/wifi.c | 57 ++++++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 42 insertions(+), 15 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index 9e9ad64..7270ee9 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -235,6 +235,9 @@ static void remove_pending_wifi_device(struct wifi_data 
*wifi)
 
 static void peer_cancel_timeout(struct wifi_data *wifi)
 {
+       if (!wifi)
+               return;
+
        if (wifi->p2p_connection_timeout > 0)
                g_source_remove(wifi->p2p_connection_timeout);
 
@@ -309,7 +312,7 @@ static int peer_connect(struct connman_peer *peer,
                return -ENODEV;
 
        wifi = connman_device_get_data(device);
-       if (!wifi)
+       if (!wifi && !wifi->interface)
                return -ENODEV;
 
        if (wifi->p2p_connecting)
@@ -417,6 +420,9 @@ static void apply_p2p_listen_on_iface(gpointer data, 
gpointer user_data)
 {
        struct wifi_data *wifi = data;
 
+       if (!wifi)
+               return;
+
        if (!wifi->interface ||
                        !g_supplicant_interface_has_p2p(wifi->interface))
                return;
@@ -578,6 +584,10 @@ static int peer_register_service(const unsigned char 
*specification,
 
        for (list = iface_list; list; list = list->next) {
                struct wifi_data *wifi = list->data;
+
+               if (!wifi)
+                       continue;
+
                GSupplicantInterface *iface = wifi->interface;
 
                if (!g_supplicant_interface_has_p2p(iface))
@@ -629,6 +639,9 @@ static int peer_unregister_wfd_service(void)
        for (list = iface_list; list; list = list->next) {
                struct wifi_data *wifi = list->data;
 
+               if (!wifi)
+                       continue;
+
                if (!g_supplicant_interface_has_p2p(wifi->interface))
                        continue;
 
@@ -663,6 +676,10 @@ static int peer_unregister_service(const unsigned char 
*specification,
 
        for (list = iface_list; list; list = list->next) {
                struct wifi_data *wifi = list->data;
+
+               if (!wifi)
+                       continue;
+
                GSupplicantInterface *iface = wifi->interface;
 
                if (wfd)
@@ -1678,11 +1695,13 @@ static gboolean p2p_find_stop(gpointer data)
 
        DBG("");
 
-       wifi->p2p_find_timeout = 0;
+       if (wifi) {
+               wifi->p2p_find_timeout = 0;
 
-       connman_device_set_scanning(device, CONNMAN_SERVICE_TYPE_P2P, false);
+               g_supplicant_interface_p2p_stop_find(wifi->interface);
+       }
 
-       g_supplicant_interface_p2p_stop_find(wifi->interface);
+       connman_device_set_scanning(device, CONNMAN_SERVICE_TYPE_P2P, false);
 
        connman_device_unref(device);
        reset_autoscan(device);
@@ -1698,20 +1717,22 @@ static void p2p_find_callback(int result, 
GSupplicantInterface *interface,
 
        DBG("result %d wifi %p", result, wifi);
 
-       if (wifi->p2p_find_timeout) {
-               g_source_remove(wifi->p2p_find_timeout);
-               wifi->p2p_find_timeout = 0;
-       }
+       if (wifi) {
+               if (wifi->p2p_find_timeout) {
+                       g_source_remove(wifi->p2p_find_timeout);
+                       wifi->p2p_find_timeout = 0;
+               }
 
-       if (result)
-               goto error;
+               if (result)
+                       goto error;
 
-       wifi->p2p_find_timeout = g_timeout_add_seconds(P2P_FIND_TIMEOUT,
-                                                       p2p_find_stop, device);
-       if (!wifi->p2p_find_timeout)
-               goto error;
+               wifi->p2p_find_timeout = g_timeout_add_seconds(P2P_FIND_TIMEOUT,
+                                                               p2p_find_stop, 
device);
+               if (!wifi->p2p_find_timeout)
+                       goto error;
 
-       return;
+               return;
+       }
 error:
        p2p_find_stop(device);
 }
@@ -2512,6 +2533,9 @@ static void p2p_support(GSupplicantInterface *interface)
 
        DBG("");
 
+       if (!interface)
+               return;
+
        if (!g_supplicant_interface_has_p2p(interface))
                return;
 
@@ -2814,6 +2838,9 @@ static void peer_changed(GSupplicantPeer *peer, 
GSupplicantPeerState state)
 
        DBG("ident: %s", identifier);
 
+       if (!wifi)
+               return;
+
        connman_peer = connman_peer_get(wifi->device, identifier);
        if (!connman_peer)
                return;
-- 
1.9.1


------------------------------

Message: 3
Date: Wed, 16 Dec 2015 12:15:51 +0000
From: John Ernberg <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [PATCH 2/3] wifi: p2p: Fix conditional for p2p driver
        unregister.
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

From: John Ernberg <[email protected]>

---
 plugins/wifi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index 7270ee9..dc8a303 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -859,7 +859,7 @@ static void check_p2p_technology(void)
                        p2p_exists = true;
        }
 
-       if (!p2p_exists) {
+       if (p2p_exists) {
                connman_technology_driver_unregister(&p2p_tech_driver);
                connman_peer_driver_unregister(&peer_driver);
        }
-- 
1.9.1


------------------------------

Message: 4
Date: Wed, 16 Dec 2015 12:15:52 +0000
From: John Ernberg <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [PATCH 3/3] wifi: p2p: Remove peers when technology is
        disabled.
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

From: John Ernberg <[email protected]>

If Wi-Fi was disabled, either by a removal of a Wi-Fi dongle, or through the
DBus API, the discovered Peers would sometimes remain as the callback from
gsupplicant would be called after the disable / destruction of the Wi-Fi
technology. This resulted in the list of Peers never being cleared.

Rewrite the peer-handling to be done more like the networks handling so that
when the technology is disabled it's possible to loop over the peers and free
them.
---
 plugins/wifi.c | 55 ++++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 40 insertions(+), 15 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index dc8a303..21f6c27 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -139,8 +139,8 @@ struct wifi_data {
        GSupplicantScanParams *scan_params;
        unsigned int p2p_find_timeout;
        unsigned int p2p_connection_timeout;
-       struct connman_peer *pending_peer;
-       GSupplicantPeer *peer;
+       struct connman_peer *peer;
+       GSList *peers;
        bool p2p_connecting;
        bool p2p_device;
        int servicing;
@@ -244,12 +244,10 @@ static void peer_cancel_timeout(struct wifi_data *wifi)
        wifi->p2p_connection_timeout = 0;
        wifi->p2p_connecting = false;
 
-       if (wifi->pending_peer) {
-               connman_peer_unref(wifi->pending_peer);
-               wifi->pending_peer = NULL;
+       if (wifi->peer) {
+               connman_peer_unref(wifi->peer);
+               wifi->peer = NULL;
        }
-
-       wifi->peer = NULL;
 }
 
 static gboolean peer_connect_timeout(gpointer data)
@@ -258,13 +256,16 @@ static gboolean peer_connect_timeout(gpointer data)
 
        DBG("");
 
-       if (wifi->p2p_connecting) {
+       if (wifi && wifi->p2p_connecting) {
                enum connman_peer_state state = CONNMAN_PEER_STATE_FAILURE;
+               GSupplicantPeer *gs_peer =
+                       g_supplicant_interface_peer_lookup(wifi->interface,
+                               connman_peer_get_identifier(wifi->peer));
 
-               if (g_supplicant_peer_has_requested_connection(wifi->peer))
+               if (g_supplicant_peer_has_requested_connection(gs_peer))
                        state = CONNMAN_PEER_STATE_IDLE;
 
-               connman_peer_set_state(wifi->pending_peer, state);
+               connman_peer_set_state(wifi->peer, state);
        }
 
        peer_cancel_timeout(wifi);
@@ -276,7 +277,11 @@ static void peer_connect_callback(int result, 
GSupplicantInterface *interface,
                                                        void *user_data)
 {
        struct wifi_data *wifi = user_data;
-       struct connman_peer *peer = wifi->pending_peer;
+
+       if (!wifi)
+               return;
+
+       struct connman_peer *peer = wifi->peer;
 
        DBG("peer %p - %d", peer, result);
 
@@ -357,8 +362,7 @@ static int peer_connect(struct connman_peer *peer,
        ret = g_supplicant_interface_p2p_connect(wifi->interface, peer_params,
                                                peer_connect_callback, wifi);
        if (ret == -EINPROGRESS) {
-               wifi->pending_peer = connman_peer_ref(peer);
-               wifi->peer = gs_peer;
+               wifi->peer = connman_peer_ref(peer);
                wifi->p2p_connecting = true;
        } else if (ret < 0) {
                g_free(peer_params->path);
@@ -811,6 +815,21 @@ static void remove_networks(struct connman_device *device,
        wifi->networks = NULL;
 }
 
+static void remove_peers(struct wifi_data *wifi)
+{
+       GSList *list;
+
+       for (list = wifi->peers; list; list = list->next) {
+               struct connman_peer *peer = list->data;
+
+               connman_peer_unregister(peer);
+               connman_peer_unref(peer);
+       }
+
+       g_slist_free(wifi->peers);
+       wifi->peers = NULL;
+}
+
 static void reset_autoscan(struct connman_device *device)
 {
        struct wifi_data *wifi = connman_device_get_data(device);
@@ -894,6 +913,7 @@ static void wifi_remove(struct connman_device *device)
                g_source_remove(wifi->p2p_connection_timeout);
 
        remove_networks(device, wifi);
+       remove_peers(wifi);
 
        connman_device_set_powered(device, false);
        connman_device_set_data(device, NULL);
@@ -1541,6 +1561,7 @@ static int wifi_disable(struct connman_device *device)
        }
 
        remove_networks(device, wifi);
+       remove_peers(wifi);
 
        ret = g_supplicant_interface_remove(wifi->interface, NULL, NULL);
        if (ret < 0)
@@ -2799,6 +2820,8 @@ static void peer_found(GSupplicantPeer *peer)
        ret = connman_peer_register(connman_peer);
        if (ret < 0 && ret != -EALREADY)
                connman_peer_unref(connman_peer);
+
+       wifi->peers = g_slist_prepend(wifi->peers, connman_peer);
 }
 
 static void peer_lost(GSupplicantPeer *peer)
@@ -2818,12 +2841,14 @@ static void peer_lost(GSupplicantPeer *peer)
        connman_peer = connman_peer_get(wifi->device, identifier);
        if (connman_peer) {
                if (wifi->p2p_connecting &&
-                               wifi->pending_peer == connman_peer) {
+                               wifi->peer == connman_peer) {
                        peer_connect_timeout(wifi);
                }
                connman_peer_unregister(connman_peer);
                connman_peer_unref(connman_peer);
        }
+
+       wifi->peers = g_slist_remove(wifi->peers, connman_peer);
 }
 
 static void peer_changed(GSupplicantPeer *peer, GSupplicantPeerState state)
@@ -2879,7 +2904,7 @@ static void peer_changed(GSupplicantPeer *peer, 
GSupplicantPeerState state)
        if (p_state == CONNMAN_PEER_STATE_CONFIGURATION ||
                                        p_state == CONNMAN_PEER_STATE_FAILURE) {
                if (wifi->p2p_connecting
-                               && connman_peer == wifi->pending_peer)
+                               && connman_peer == wifi->peer)
                        peer_cancel_timeout(wifi);
                else
                        p_state = CONNMAN_PEER_STATE_UNKNOWN;
-- 
1.9.1


------------------------------

Message: 5
Date: Wed, 16 Dec 2015 13:27:14 +0100
From: Tomasz Bursztyka <[email protected]>
To: [email protected]
Subject: Re: [PATCH 2/3] wifi: p2p: Fix conditional for p2p driver
        unregister.
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed

Hi John,

> From: John Ernberg <[email protected]>
>
> ---
>   plugins/wifi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/plugins/wifi.c b/plugins/wifi.c
> index 7270ee9..dc8a303 100644
> --- a/plugins/wifi.c
> +++ b/plugins/wifi.c
> @@ -859,7 +859,7 @@ static void check_p2p_technology(void)
>                       p2p_exists = true;
>       }
>   
> -     if (!p2p_exists) {
> +     if (p2p_exists) {
>               connman_technology_driver_unregister(&p2p_tech_driver);
>               connman_peer_driver_unregister(&peer_driver);

So if the wifi device supports P2P you remove its exposure into ConnMan?


What are you trying to fix here?


Tomasz


------------------------------

Message: 6
Date: Wed, 16 Dec 2015 13:28:04 +0100
From: Tomasz Bursztyka <[email protected]>
To: [email protected]
Subject: Re: [PATCH 1/3] wifi: p2p: Fix several unref of NULL pointer.
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed

Looks fine to me.

Tomasz


------------------------------

Message: 7
Date: Wed, 16 Dec 2015 13:52:19 +0100
From: Tomasz Bursztyka <[email protected]>
To: [email protected]
Subject: Re: [PATCH 3/3] wifi: p2p: Remove peers when technology is
        disabled.
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed

Hi John,

NACK.

> From: John Ernberg <[email protected]>
>
> If Wi-Fi was disabled, either by a removal of a Wi-Fi dongle, or through the
> DBus API, the discovered Peers would sometimes remain as the callback from
> gsupplicant would be called after the disable / destruction of the Wi-Fi
> technology. This resulted in the list of Peers never being cleared.

Gsupplicant follows wpa_supplicant. So if wpa_s does not clear up its 
peer list,
gsupplicant (and wifi plugin so) won't either. Then the bug is in wpa_s

That said, if wpa_s is actually clearing up its list but not gsupplicant 
then this last
one has a bug.

But I don't see this in your patch, you are doing all in wifi plugin, 
thus interpreting
stuff there. Plus you are adding code which does not match any of your 
commit message.

>
> Rewrite the peer-handling to be done more like the networks handling so that
> when the technology is disabled it's possible to loop over the peers and free
> them.

Don't follow the same logic as networks. It's much different.

> ---
>   plugins/wifi.c | 55 ++++++++++++++++++++++++++++++++++++++++---------------
>   1 file changed, 40 insertions(+), 15 deletions(-)
>
> diff --git a/plugins/wifi.c b/plugins/wifi.c
> index dc8a303..21f6c27 100644
> --- a/plugins/wifi.c
> +++ b/plugins/wifi.c
> @@ -139,8 +139,8 @@ struct wifi_data {
>       GSupplicantScanParams *scan_params;
>       unsigned int p2p_find_timeout;
>       unsigned int p2p_connection_timeout;
> -     struct connman_peer *pending_peer;
> -     GSupplicantPeer *peer;
> +     struct connman_peer *peer;

No renaming please.

> +     GSList *peers;

Ok, let's see the point below.

>       bool p2p_connecting;
>       bool p2p_device;
>       int servicing;
> @@ -244,12 +244,10 @@ static void peer_cancel_timeout(struct wifi_data *wifi)
>       wifi->p2p_connection_timeout = 0;
>       wifi->p2p_connecting = false;
>   
> -     if (wifi->pending_peer) {
> -             connman_peer_unref(wifi->pending_peer);
> -             wifi->pending_peer = NULL;
> +     if (wifi->peer) {
> +             connman_peer_unref(wifi->peer);
> +             wifi->peer = NULL;
>       }
> -
> -     wifi->peer = NULL;

So no renaming here as well.

>   }
>   
>   static gboolean peer_connect_timeout(gpointer data)
> @@ -258,13 +256,16 @@ static gboolean peer_connect_timeout(gpointer data)
>   
>       DBG("");
>   
> -     if (wifi->p2p_connecting) {
> +     if (wifi && wifi->p2p_connecting) {

Checking the validity of wifi should go in your patch 2, not here.

>               enum connman_peer_state state = CONNMAN_PEER_STATE_FAILURE;
> +             GSupplicantPeer *gs_peer =
> +                     g_supplicant_interface_peer_lookup(wifi->interface,
> +                             connman_peer_get_identifier(wifi->peer));
>   

ok, but a real fix would be to properly track peers from gsupplicant, 
then through wifi.c and finaly to peer.c
If it happens that a peer is still in peer.c but not in gsupplicant 
anymore then we have a bug. And the logic
here is just a workaround I'd prefer not to see.

> -             if (g_supplicant_peer_has_requested_connection(wifi->peer))
> +             if (g_supplicant_peer_has_requested_connection(gs_peer))
>                       state = CONNMAN_PEER_STATE_IDLE;
>   
> -             connman_peer_set_state(wifi->pending_peer, state);
> +             connman_peer_set_state(wifi->peer, state);
>       }
>   
>       peer_cancel_timeout(wifi);
> @@ -276,7 +277,11 @@ static void peer_connect_callback(int result, 
> GSupplicantInterface *interface,
>                                                       void *user_data)
>   {
>       struct wifi_data *wifi = user_data;
> -     struct connman_peer *peer = wifi->pending_peer;
> +
> +     if (!wifi)
> +             return;
> +

Into your patch 2.

> +     struct connman_peer *peer = wifi->peer;

No renaming.

>   
>       DBG("peer %p - %d", peer, result);
>   
> @@ -357,8 +362,7 @@ static int peer_connect(struct connman_peer *peer,
>       ret = g_supplicant_interface_p2p_connect(wifi->interface, peer_params,
>                                               peer_connect_callback, wifi);
>       if (ret == -EINPROGRESS) {
> -             wifi->pending_peer = connman_peer_ref(peer);
> -             wifi->peer = gs_peer;
> +             wifi->peer = connman_peer_ref(peer);
>               wifi->p2p_connecting = true;
>       } else if (ret < 0) {
>               g_free(peer_params->path);
> @@ -811,6 +815,21 @@ static void remove_networks(struct connman_device 
> *device,
>       wifi->networks = NULL;
>   }
>   
> +static void remove_peers(struct wifi_data *wifi)
> +{
> +     GSList *list;
> +
> +     for (list = wifi->peers; list; list = list->next) {
> +             struct connman_peer *peer = list->data;
> +
> +             connman_peer_unregister(peer);
> +             connman_peer_unref(peer);
> +     }
> +
> +     g_slist_free(wifi->peers);
> +     wifi->peers = NULL;
> +}
> +
>   static void reset_autoscan(struct connman_device *device)
>   {
>       struct wifi_data *wifi = connman_device_get_data(device);
> @@ -894,6 +913,7 @@ static void wifi_remove(struct connman_device *device)
>               g_source_remove(wifi->p2p_connection_timeout);
>   
>       remove_networks(device, wifi);
> +     remove_peers(wifi);


We follow the peers from wpa_supplicant -> gsupplicant -> wifi.c -> peer.c
So that chain should "always" work. Plus the logic of peers is much 
different with wifi networks and services.
as there is no in-between objects like networks.

So no need of that.


>   
>       connman_device_set_powered(device, false);
>       connman_device_set_data(device, NULL);
> @@ -1541,6 +1561,7 @@ static int wifi_disable(struct connman_device *device)
>       }
>   
>       remove_networks(device, wifi);
> +     remove_peers(wifi);

See, here also no need of that. Unless wpa_s does something wrong ... 
which would need to be fixed there.

Finally in this patch, I don't see the point of your internal list of 
peers then.

>   
>       ret = g_supplicant_interface_remove(wifi->interface, NULL, NULL);
>       if (ret < 0)
> @@ -2799,6 +2820,8 @@ static void peer_found(GSupplicantPeer *peer)
>       ret = connman_peer_register(connman_peer);
>       if (ret < 0 && ret != -EALREADY)
>               connman_peer_unref(connman_peer);
> +
> +     wifi->peers = g_slist_prepend(wifi->peers, connman_peer);
>   }
>   
>   static void peer_lost(GSupplicantPeer *peer)
> @@ -2818,12 +2841,14 @@ static void peer_lost(GSupplicantPeer *peer)
>       connman_peer = connman_peer_get(wifi->device, identifier);
>       if (connman_peer) {
>               if (wifi->p2p_connecting &&
> -                             wifi->pending_peer == connman_peer) {
> +                             wifi->peer == connman_peer) {

No renaming.

>                       peer_connect_timeout(wifi);
>               }
>               connman_peer_unregister(connman_peer);
>               connman_peer_unref(connman_peer);
>       }
> +
> +     wifi->peers = g_slist_remove(wifi->peers, connman_peer);
>   }
>   
>   static void peer_changed(GSupplicantPeer *peer, GSupplicantPeerState state)
> @@ -2879,7 +2904,7 @@ static void peer_changed(GSupplicantPeer *peer, 
> GSupplicantPeerState state)
>       if (p_state == CONNMAN_PEER_STATE_CONFIGURATION ||
>                                       p_state == CONNMAN_PEER_STATE_FAILURE) {
>               if (wifi->p2p_connecting
> -                             && connman_peer == wifi->pending_peer)
> +                             && connman_peer == wifi->peer)

No renaming.

>                       peer_cancel_timeout(wifi);
>               else
>                       p_state = CONNMAN_PEER_STATE_UNKNOWN;


To sum up, have you experienced a wpa_s peer list being empty, but not 
in connman?
If so, then the bug is in gsupplicant or wifi.c or peer.c  (a reference 
count maybe etc...)

But here your patch is just adding a logic we don't need. When you 
disable wifi, wpa_s will
destroy its objects, thus guspplicant will do the same etc... Your code 
is unnecessary overhead.
It's a shortcut for something that will happen anyway.


Tomasz


------------------------------

Subject: Digest Footer

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


------------------------------

End of connman Digest, Vol 2, Issue 16
**************************************

Reply via email to