summaryrefslogtreecommitdiff
path: root/plugins/wifi.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wifi.c')
-rw-r--r--plugins/wifi.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index f8c22be3..fc304e3b 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -59,11 +59,13 @@
#include <gsupplicant/gsupplicant.h>
+#include "src/shared/util.h"
+
#define CLEANUP_TIMEOUT 8 /* in seconds */
#define INACTIVE_TIMEOUT 12 /* in seconds */
#define FAVORITE_MAXIMUM_RETRIES 2
-#define BGSCAN_DEFAULT "simple:30:-45:300"
+#define BGSCAN_DEFAULT "simple:30:-65:300"
#define AUTOSCAN_EXPONENTIAL "exponential:3:300"
#define AUTOSCAN_SINGLE "single:3"
@@ -1611,15 +1613,15 @@ static int wifi_disable(struct connman_device *device)
}
struct last_connected {
- GTimeVal modified;
+ struct timeval modified;
gchar *ssid;
int freq;
};
static gint sort_entry(gconstpointer a, gconstpointer b, gpointer user_data)
{
- GTimeVal *aval = (GTimeVal *)a;
- GTimeVal *bval = (GTimeVal *)b;
+ struct timeval *aval = (struct timeval *)a;
+ struct timeval *bval = (struct timeval *)b;
/* Note that the sort order is descending */
if (aval->tv_sec < bval->tv_sec)
@@ -1646,7 +1648,7 @@ static int get_latest_connections(int max_ssids,
GSequence *latest_list;
struct last_connected *entry;
GKeyFile *keyfile;
- GTimeVal modified;
+ struct timeval modified;
gchar **services;
gchar *str;
char *ssid;
@@ -1690,7 +1692,7 @@ static int get_latest_connections(int max_ssids,
g_key_file_free(keyfile);
continue;
}
- g_time_val_from_iso8601(str, &modified);
+ util_iso8601_to_timeval(str, &modified);
g_free(str);
ssid = g_key_file_get_string(keyfile,
@@ -2228,7 +2230,7 @@ static void disconnect_callback(int result, GSupplicantInterface *interface,
return;
}
- if (wifi->network != wifi->pending_network)
+ if (wifi->network && wifi->network != wifi->pending_network)
connman_network_set_connected(wifi->network, false);
wifi->network = NULL;
@@ -3356,15 +3358,15 @@ static void sta_remove_callback(int result,
info->wifi->tethering = false;
connman_technology_tethering_notify(info->technology, false);
- g_free(info->ifname);
- g_free(info->ssid);
- g_free(info);
-
if (info->wifi->ap_supported == WIFI_AP_SUPPORTED) {
g_free(info->wifi->tethering_param->ssid);
g_free(info->wifi->tethering_param);
info->wifi->tethering_param = NULL;
}
+
+ g_free(info->ifname);
+ g_free(info->ssid);
+ g_free(info);
return;
}