From: Daniel Wagner <[email protected]>

When a network is destroyed we also have to remove the pointer
from the wifi data structure.

connmand[25303]: plugins/wifi.c:network_remove() network 0x69c350
connmand[25303]: src/network.c:connman_network_unref() network 0x69c350 name 
bmwnet02 refcount 1
connmand[25303]: src/network.c:connman_network_unref() network 0x69c350 name 
bmwnet02 refcount 0
connmand[25303]: src/network.c:network_destruct() network 0x69c350 name bmwnet02

[...]

connmand[25303]: plugins/wifi.c:interface_state() wifi 0x699d60 interface state 
1
connmand[25303]: plugins/wifi.c:is_idle() state 9
connmand[25303]: src/network.c:connman_network_set_associating() network 
0x69c350 associating 0
connmand[25303]: src/network.c:connman_network_set_connected() network 0x69c350 
connected 0
---

I failed to remove the SSID in the previous commit message. Who cares anymway.

 plugins/wifi.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index 8b7a97c..469ec67 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -333,7 +333,19 @@ static int network_probe(struct connman_network *network)
 
 static void network_remove(struct connman_network *network)
 {
+       struct connman_device *device = connman_network_get_device(network);
+       struct wifi_data *wifi;
+
        DBG("network %p", network);
+
+       wifi = connman_device_get_data(device);
+       if (wifi == NULL)
+               return;
+
+       if (wifi->network != network)
+               return;
+
+       wifi->network = NULL;
 }
 
 static void connect_callback(int result, GSupplicantInterface *interface,
-- 
1.7.6

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

Reply via email to