summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-01-14 18:36:35 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-02-02 18:45:35 +0100
commit194b06ab47c9f7e493c3bc866b300280695e5a83 (patch)
tree29268c62363eb7ec5e6cc3944b64f7b839e7558f /plugins
parentfe35ac1aaf5897104963012fef42573f391ff2b4 (diff)
downloadconnman-194b06ab47c9f7e493c3bc866b300280695e5a83.tar.gz
connman-194b06ab47c9f7e493c3bc866b300280695e5a83.tar.bz2
connman-194b06ab47c9f7e493c3bc866b300280695e5a83.zip
wifi: Track interfaces
Diffstat (limited to 'plugins')
-rw-r--r--plugins/wifi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index aa661b54..6e1e3420 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -70,6 +70,8 @@ struct wifi_data {
unsigned int watch;
};
+static GList *iface_list = NULL;
+
static int get_bssid(struct connman_device *device,
unsigned char *bssid, unsigned int *bssid_len)
{
@@ -159,6 +161,8 @@ static int wifi_probe(struct connman_device *device)
wifi->watch = connman_rtnl_add_newlink_watch(wifi->index,
wifi_newlink, device);
+ iface_list = g_list_append(iface_list, wifi);
+
return 0;
}
@@ -168,6 +172,11 @@ static void wifi_remove(struct connman_device *device)
DBG("device %p", device);
+ if (wifi == NULL)
+ return;
+
+ iface_list = g_list_remove(iface_list, wifi);
+
if (wifi->pending_network != NULL) {
connman_network_unref(wifi->pending_network);
wifi->pending_network = NULL;