Commit 3629617c authored by Santtu Lakkala's avatar Santtu Lakkala

Merge branch 'jb46450' into 'master'

[connman] Fix hidden WiFi crashes and hidden property saving. JB#46450

See merge request mer-core/connman!224
parents bce88c4d 308b37c8
......@@ -54,6 +54,8 @@ Methods void Release()
keys are the field names and the values are the
actual fields. Alternatively an error indicating that
the request got canceled can be returned.
OperationAborted will be return on a successfull
cancel request.
Most common return field names are "Name" and of
course "Passphrase".
......
......@@ -152,6 +152,7 @@ struct wifi_bss {
gulong event_id[BSS_EVENT_COUNT];
GUtilIntHistory *history; /* Signal strength history */
guint strength; /* Median strength */
gboolean hidden;
};
typedef enum wifi_network_state {
......@@ -2558,8 +2559,14 @@ static void wifi_device_bss_add_3(struct wifi_device *dev,
}
if (net) {
struct connman_service *service;
DBG("adding %s to %s", bss->path, ident);
service = connman_service_lookup_from_network(net->network);
GASSERT(service);
if (service && bss_data->hidden)
__connman_service_set_hidden(service);
/*
* We are keeping BSS-less networks alive for some time in
* the hope that they will recover. And sometimes they do!
......@@ -2589,6 +2596,8 @@ static void wifi_device_bss_add_3(struct wifi_device *dev,
service = connman_service_lookup_from_network(net->network);
GASSERT(service);
if (service) {
if (bss_data->hidden)
__connman_service_set_hidden(service);
connman_service_create_ip4config(service, dev->ifi);
connman_service_create_ip6config(service, dev->ifi);
}
......@@ -2705,11 +2714,14 @@ static void wifi_device_bss_add_2(struct wifi_device *dev,
/* Assign SSID and add put it back */
hidden->ssid = g_bytes_ref(bss->ssid);
wifi_device_bss_add_3(dev, hidden);
bss_data->hidden = TRUE;
}
} else {
/* No SSID broadcast */
struct wifi_bss *named = wifi_device_named_bss(dev,
bss->bssid);
bss_data->hidden = TRUE;
if (named) {
/* We already know SSID for this network */
bss_data->ssid = g_bytes_ref(named->ssid);
......@@ -2717,6 +2729,7 @@ static void wifi_device_bss_add_2(struct wifi_device *dev,
(int)g_bytes_get_size(named->ssid),
(char*)g_bytes_get_data(named->ssid,
NULL));
named->hidden = TRUE;
}
}
wifi_device_bss_add_3(dev, bss_data);
......
......@@ -5647,6 +5647,8 @@ static void switch_default_service(struct connman_service *default_service,
downgrade_state(downgrade_service);
}
static void service_schedule_changed(void);
static DBusMessage *move_service(DBusConnection *conn,
DBusMessage *msg, void *user_data,
bool before)
......@@ -5753,6 +5755,8 @@ static DBusMessage *move_service(DBusConnection *conn,
__connman_connection_update_gateway();
service_schedule_changed();
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
......@@ -6805,18 +6809,21 @@ static void request_input_cb(struct connman_service *service,
if (g_strcmp0(error,
"net.connman.Agent.Error.Canceled") == 0) {
err = -EINVAL;
err = -ECONNABORTED;
if (service->hidden)
__connman_service_return_error(service,
ECONNABORTED,
user_data);
goto done;
} else {
err = -ETIMEDOUT;
if (service->hidden)
__connman_service_return_error(service,
ETIMEDOUT, user_data);
}
goto done;
}
if (!service->network) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment