Re: connmand[186]: Online check failed but running dhclient manually fixes this issue
by Denis Kenzior
Hi,
On 09/05/2017 09:46 AM, Alexander Couzens wrote:
> On Thu, 10 Aug 2017 12:47:28 +0200
> Daniel Wagner <wagi(a)monom.org> wrote:
>
>>> Bus 001 Device 003: ID 1bc7:1201 Telit Wireless Solutions
>>
>> Here is a compile tested 'fix'. I don't know if this works and\
>> obviously it doesn't follow the coding guide lines for this
>> project. If you could test this and report back the outcome
>> that would be really helpful. Then I can create a proper
>> patch for Denis.
>
> I can confirm this bug with an quectel ec20 using the firmware
> EC20EQAR02A13E2G 1 [Jul 5 2017 10:49:17].
>
> To reproduce using ofono w/o connman. linux 4.12.8
> - call ofono "../context1 Active true"
> - set the ip by hand. No ping response.
> - using dhcpcd. Ping responses.
>
> The `ip addr show` looks the same, except the interface has now an ipv6
> link local address. Is this is problem of modern LTE cards?
> Could be raw-ip or 802.3 encapsulations the problem?
>
Here's something Reinhard said in a different thread that might be
applicable here:
"Unfortunately the PLS8 seems to need DHCP to be used as a trigger to
pass IPv4 traffic over the network interface even if the parameters
could be obtained from AT commands.
This restriction also holds for some other Qualcomm firmwares when the
QMI network interface is used in Ethernet mode instead of Raw IP mode."
If this is true, then falling back to DHCP would seem to be required for
many Qualcomm based devices. This seems to be a recently introduced
'bug' as older QMI devices did not need this workaround.
Regards,
-Denis
3 years, 1 month
When BackgroundScanning = false, connman's Scan() dbus method is broken
by Jonah Petri
Hello,
I want to report an issue with connman. We set BackgroundScanning = false in main.conf. However, I have found that this also causes connman to give an erroneous empty response to the Scan() dbus call, potentially permanently disabling the device.
The key preconditions seem to be:
1) wpa_supplicant reports a max_ssids > 1
2) the computer must have been previously associated to a SSID which is no longer visible
3) as above, BackgroundScanning must be set to false
This causes the logic of wifi.c:wifi_scan() to fail. In particular:
1) wifi_scan_simple is not used, due to the above preconditions.
2) connman requests an active scan via wpa_supplicant for the ssids returned by get_latest_connections.
3) connman does not request a followup passive scan, as BackgroundScanning is turned off, which causes start_autoscan() to exit early.
This means that in the scenario above, connman will never see any wifi networks. Scan() will always return an empty list, even if other SSIDs are available. This is potentially fatal for embedded systems, so in my view this is a very serious issue.
This issue affects at least connman 1.33 and 1.34. I cannot test older versions due to other dependencies.
One workaround is to enable BackgroundScanning.
Best,
Jonah
3 years, 3 months
[PATCH] session: Add ContextIdentifier
by Daniel Wagner
From: Bjoern Thorwirth <external.bjoern.thorwirth(a)de.bosch.com>
The calling process, that implements the session API is identified by
the user ID as it is runs. All processes of the same user share the
same list of allowed bearers, and the same priority for choosing
between available bearers.
This extension allows processes to select a service context dependent
behaviour for which the routing decision is made.
This is an extention to session API interface. Helps to enable a
service differentiation for processes run by the same user. Allows
ConnMan to differentiate between bearer usage permissions and the
respective priorities based on the requested service type.
---
Hi,
after an offline discussion with Bjorn, we came to the conclusion that
my idea with AllowedServices is going into the wrong
direction. At least for his use case.
Propably I got confused by the name 'Session'. By calling this
ContextIdentifier we should avoid this confusion. In the end it is
just an additonal information given by the application to support the
bearer selection algorithm. Currently, the session code in ConnMan
doesn't make use of it, but a session plugin can use it. That is what
Bjorn does.
Thanks,
Daniel
doc/session-api.txt | 11 +++++++++++
include/session.h | 1 +
src/session.c | 17 +++++++++++++++++
3 files changed, 29 insertions(+)
diff --git a/doc/session-api.txt b/doc/session-api.txt
index e8da5224dbf7..46ac5f3dc94a 100644
--- a/doc/session-api.txt
+++ b/doc/session-api.txt
@@ -205,3 +205,14 @@ Settings string State [readonly]
a default route. When the source IP rule is enabled,
an application can select which session/interface to
send traffic on, using bind-before-connect mechanism.
+
+ string ContextIdentifier [readwrite] [experimental]
+
+ The application can provide an identifier for a
+ session. If an application runs several session
+ at the same time, the additional information
+ can be used by ConnMan to assign different
+ bearers according the identifier. For example
+ a web browser creates per tab a session. For
+ each session a different should bearer be
+ assigned.
diff --git a/include/session.h b/include/session.h
index 5106e886b9ab..39f3368554ed 100644
--- a/include/session.h
+++ b/include/session.h
@@ -74,6 +74,7 @@ struct connman_session_config {
GSList *allowed_bearers;
char *allowed_interface;
bool source_ip_rule;
+ char *context_identifier;
};
typedef int (* connman_session_config_func_t) (struct connman_session *session,
diff --git a/src/session.c b/src/session.c
index 9e3c55941ee6..108228a820a7 100644
--- a/src/session.c
+++ b/src/session.c
@@ -548,6 +548,7 @@ struct creation_data {
GSList *allowed_bearers;
char *allowed_interface;
bool source_ip_rule;
+ char *context_identifier;
};
static void cleanup_creation_data(struct creation_data *creation_data)
@@ -557,6 +558,8 @@ static void cleanup_creation_data(struct creation_data *creation_data)
if (creation_data->pending)
dbus_message_unref(creation_data->pending);
+ if (creation_data->context_identifier)
+ g_free(creation_data->context_identifier);
g_slist_free(creation_data->allowed_bearers);
g_free(creation_data->allowed_interface);
@@ -927,6 +930,17 @@ static void append_notify(DBusMessageIter *dict,
}
if (session->append_all ||
+ info->config.context_identifier != info_last->config.context_identifier) {
+ char *ifname = info->config.context_identifier;
+ if (!ifname)
+ ifname = "";
+ connman_dbus_dict_append_basic(dict, "Context_Identifier",
+ DBUS_TYPE_STRING,
+ &ifname);
+ info_last->config.context_identifier = info->config.context_identifier;
+ }
+
+ if (session->append_all ||
info->config.source_ip_rule != info_last->config.source_ip_rule) {
dbus_bool_t source_ip_rule = FALSE;
if (info->config.source_ip_rule)
@@ -1474,6 +1488,9 @@ int __connman_session_create(DBusMessage *msg)
connman_session_parse_connection_type(val);
user_connection_type = true;
+ } else if (g_str_equal(key, "ContextIdentifier")) {
+ dbus_message_iter_get_basic(&value, &val);
+ creation_data->context_identifier = g_strdup(val);
} else if (g_str_equal(key, "AllowedInterface")) {
dbus_message_iter_get_basic(&value, &val);
creation_data->allowed_interface = g_strdup(val);
--
2.9.5
3 years, 3 months
[PATCH 1/2] resolver: add support for systemd-resolved.
by Ismo Puustinen
If systemd-resolved is running, use it for DNS address resolution. In
this case just deliver the DNS addresses to systemd-resolved and do not
run our own DNS proxy. The systemd-resolved support is selected to
be used if command line option "-s" is passed to connmand. This
implicitly disables connmand's DNS proxy.
---
src/connman.h | 2 +-
src/main.c | 5 +-
src/resolver.c | 234 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
3 files changed, 229 insertions(+), 12 deletions(-)
diff --git a/src/connman.h b/src/connman.h
index 21b70802..1f7afdbc 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -249,7 +249,7 @@ char **__connman_inet_get_pnp_nameservers(const char *pnp_file);
#include <connman/resolver.h>
-int __connman_resolver_init(gboolean dnsproxy);
+int __connman_resolver_init(gboolean dnsproxy, gboolean resolved);
void __connman_resolver_cleanup(void);
void __connman_resolver_append_fallback_nameservers(void);
int __connman_resolvfile_append(int index, const char *domain, const char *server);
diff --git a/src/main.c b/src/main.c
index b78a0461..2cb5c56e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -511,6 +511,7 @@ static gchar *option_noplugin = NULL;
static gchar *option_wifi = NULL;
static gboolean option_detach = TRUE;
static gboolean option_dnsproxy = TRUE;
+static gboolean option_resolved = FALSE;
static gboolean option_backtrace = TRUE;
static gboolean option_version = FALSE;
@@ -572,6 +573,8 @@ static GOptionEntry options[] = {
{ "nodnsproxy", 'r', G_OPTION_FLAG_REVERSE,
G_OPTION_ARG_NONE, &option_dnsproxy,
"Don't enable DNS Proxy" },
+ { "resolvedproxy", 's', 0, G_OPTION_ARG_NONE, &option_resolved,
+ "Use systemd-resolved for DNS management" },
{ "nobacktrace", 0, G_OPTION_FLAG_REVERSE,
G_OPTION_ARG_NONE, &option_backtrace,
"Don't print out backtrace information" },
@@ -762,7 +765,7 @@ int main(int argc, char *argv[])
__connman_plugin_init(option_plugin, option_noplugin);
- __connman_resolver_init(option_dnsproxy);
+ __connman_resolver_init(option_dnsproxy, option_resolved);
__connman_rtnl_start();
__connman_dhcp_init();
__connman_dhcpv6_init();
diff --git a/src/resolver.c b/src/resolver.c
index 75ea5ba6..62abb4a2 100644
--- a/src/resolver.c
+++ b/src/resolver.c
@@ -32,11 +32,15 @@
#include <sys/stat.h>
#include <resolv.h>
#include <netdb.h>
+#include <gdbus.h>
+#include <connman/dbus.h>
#include "connman.h"
#define RESOLV_CONF_STATEDIR STATEDIR"/resolv.conf"
#define RESOLV_CONF_ETC "/etc/resolv.conf"
+#define SYSTEMD_RESOLVED_SERVICE "org.freedesktop.resolve1"
+#define SYSTEMD_RESOLVED_PATH "/org/freedesktop/resolve1"
#define RESOLVER_FLAG_PUBLIC (1 << 0)
@@ -58,6 +62,9 @@ struct entry_data {
static GSList *entry_list = NULL;
static bool dnsproxy_enabled = false;
+static DBusConnection *connection = NULL;
+static GDBusClient *client = NULL;
+static GDBusProxy *resolved_proxy = NULL;
struct resolvfile_entry {
int index;
@@ -67,6 +74,154 @@ struct resolvfile_entry {
static GList *resolvfile_list = NULL;
+static void revertlink_append(DBusMessageIter *iter, void *user_data)
+{
+ int *index = user_data;
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_INT32, index);
+}
+
+static int resolved_remove_all(int index)
+{
+ gboolean result;
+
+ result = g_dbus_proxy_method_call(resolved_proxy, "RevertLink",
+ revertlink_append, NULL, &index, NULL);
+
+ if (result == FALSE)
+ return -EINVAL;
+
+ return 0;
+}
+
+static void setlinkdns_append(DBusMessageIter *iter, void *user_data)
+{
+ struct resolvfile_entry *entry = NULL;
+ int result, *index = user_data;
+ unsigned i;
+ int type;
+ char ipv4_bytes[4];
+ char ipv6_bytes[16];
+ GList *list;
+
+ DBusMessageIter address_array, struct_array, byte_array;
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_INT32, index);
+
+ dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "(iay)",
+ &address_array);
+
+ for (list = g_list_first(resolvfile_list); list; list = g_list_next(list)) {
+ entry = list->data;
+
+ DBG("setlinkdns_append: index: %d, server: %s, domain: %s",
+ entry->index, entry->server ? entry->server : "NULL",
+ entry->domain ? entry->domain : "NULL");
+
+ if (entry->index != *index || entry->server == NULL)
+ continue;
+
+ dbus_message_iter_open_container(&address_array, DBUS_TYPE_STRUCT, NULL,
+ &struct_array);
+
+ type = connman_inet_check_ipaddress(entry->server);
+
+ if (type == AF_INET) {
+ result = inet_pton(type, entry->server, ipv4_bytes);
+ if (!result) {
+ DBG("Failed to parse IPv4 address: %s", entry->server);
+ return;
+ }
+ dbus_message_iter_append_basic(&struct_array, DBUS_TYPE_INT32,
+ &type);
+ dbus_message_iter_open_container(&struct_array, DBUS_TYPE_ARRAY,
+ "y", &byte_array);
+ for (i = 0; i < sizeof(ipv4_bytes); i++) {
+ dbus_message_iter_append_basic(&byte_array, DBUS_TYPE_BYTE,
+ &(ipv4_bytes[i]));
+ }
+ dbus_message_iter_close_container(&struct_array, &byte_array);
+ }
+ else {
+ result = inet_pton(type, entry->server, ipv6_bytes);
+ if (!result) {
+ DBG("Failed to parse IPv4 address: %s", entry->server);
+ return;
+ }
+ dbus_message_iter_append_basic(&struct_array, DBUS_TYPE_INT32,
+ &type);
+ dbus_message_iter_open_container(&struct_array, DBUS_TYPE_ARRAY,
+ "y", &byte_array);
+ for (i = 0; i < sizeof(ipv6_bytes); i++) {
+ dbus_message_iter_append_basic(&byte_array, DBUS_TYPE_BYTE,
+ &(ipv6_bytes[i]));
+ }
+ dbus_message_iter_close_container(&struct_array, &byte_array);
+ }
+ dbus_message_iter_close_container(&address_array, &struct_array);
+ }
+
+ dbus_message_iter_close_container(iter, &address_array);
+}
+
+static void setlinkdomains_append(DBusMessageIter *iter, void *user_data)
+{
+ struct resolvfile_entry *entry;
+ int *index = user_data;
+ DBusMessageIter domain_array, struct_array;
+ gboolean only_routing = FALSE;
+ GList *list;
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_INT32, index);
+
+ dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "(sb)",
+ &domain_array);
+
+ for (list = g_list_first(resolvfile_list); list; list = g_list_next(list)) {
+ entry = list->data;
+
+ DBG("setlinkdomains_append: index: %d, server: %s, domain: %s",
+ entry->index, entry->server ? entry->server : "NULL",
+ entry->domain ? entry->domain : "NULL");
+
+ if (entry->index != *index || entry->domain == NULL)
+ continue;
+
+ dbus_message_iter_open_container(&domain_array, DBUS_TYPE_STRUCT, NULL,
+ &struct_array);
+
+ dbus_message_iter_append_basic(&struct_array, DBUS_TYPE_STRING,
+ &entry->domain);
+ dbus_message_iter_append_basic(&struct_array, DBUS_TYPE_BOOLEAN,
+ &only_routing);
+
+ dbus_message_iter_close_container(&domain_array, &struct_array);
+ }
+ dbus_message_iter_close_container(iter, &domain_array);
+}
+
+static int resolved_export(int index)
+{
+ gboolean result;
+
+ if (!resolved_proxy)
+ return -ENOENT;
+
+ /* No async error processing -- just fire and forget */
+
+ result = g_dbus_proxy_method_call(resolved_proxy, "SetLinkDNS",
+ setlinkdns_append, NULL, &index, NULL);
+ if (result == FALSE)
+ return -EINVAL;
+
+ result = g_dbus_proxy_method_call(resolved_proxy, "SetLinkDomains",
+ setlinkdomains_append, NULL, &index, NULL);
+ if (result == FALSE)
+ return -EINVAL;
+
+ return 0;
+}
+
static void resolvfile_remove_entries(GList *entries)
{
GList *list;
@@ -188,11 +343,14 @@ int __connman_resolvfile_append(int index, const char *domain,
resolvfile_list = g_list_append(resolvfile_list, entry);
+ if (resolved_proxy)
+ return resolved_export(index);
+
return resolvfile_export();
}
-int __connman_resolvfile_remove(int index, const char *domain,
- const char *server)
+static int __connman_resolvfile_remove_entry(int index, const char *domain,
+ const char *server, gboolean remove_from_resolved)
{
GList *list, *matches = NULL;
@@ -215,9 +373,22 @@ int __connman_resolvfile_remove(int index, const char *domain,
resolvfile_remove_entries(matches);
+ if (resolved_proxy) {
+ if (remove_from_resolved)
+ return resolved_export(index);
+ else
+ return 0; /* whole link is reset later */
+ }
+
return resolvfile_export();
}
+int __connman_resolvfile_remove(int index, const char *domain,
+ const char *server)
+{
+ return __connman_resolvfile_remove_entry(index, domain, server, TRUE);
+}
+
void __connman_resolver_append_fallback_nameservers(void)
{
GSList *list;
@@ -269,7 +440,7 @@ static void remove_fallback_nameservers(void)
}
}
-static void remove_entries(GSList *entries)
+static void remove_entries(GSList *entries, int index)
{
GSList *list;
@@ -282,8 +453,8 @@ static void remove_entries(GSList *entries)
__connman_dnsproxy_remove(entry->index, entry->domain,
entry->server);
} else {
- __connman_resolvfile_remove(entry->index, entry->domain,
- entry->server);
+ __connman_resolvfile_remove_entry(entry->index, entry->domain,
+ entry->server, index < 0 ? TRUE : FALSE);
}
if (entry->timeout)
@@ -295,6 +466,9 @@ static void remove_entries(GSList *entries)
g_slist_free(entries);
+ if (resolved_proxy && index >= 0)
+ resolved_remove_all(index);
+
__connman_resolver_append_fallback_nameservers();
}
@@ -316,7 +490,7 @@ static gboolean resolver_expire_cb(gpointer user_data)
entry->server, true);
}
- remove_entries(list);
+ remove_entries(list, -1);
return FALSE;
}
@@ -538,7 +712,7 @@ int connman_resolver_remove(int index, const char *domain, const char *server)
if (!matches)
return -ENOENT;
- remove_entries(matches);
+ remove_entries(matches, -1);
return 0;
}
@@ -570,7 +744,10 @@ int connman_resolver_remove_all(int index)
if (!matches)
return -ENOENT;
- remove_entries(matches);
+ if (resolved_proxy)
+ return resolved_remove_all(index);
+
+ remove_entries(matches, index);
return 0;
}
@@ -652,12 +829,34 @@ static void free_resolvfile(gpointer data)
g_free(entry);
}
-int __connman_resolver_init(gboolean dnsproxy)
+int __connman_resolver_init(gboolean dnsproxy, gboolean resolved)
{
int i;
char **ns;
- DBG("dnsproxy %d", dnsproxy);
+ DBG("dnsproxy %d, resolved %d", dnsproxy, resolved);
+
+ if (resolved) {
+ connection = connman_dbus_get_connection();
+
+ if (connection) {
+ client = g_dbus_client_new(connection,
+ SYSTEMD_RESOLVED_SERVICE, SYSTEMD_RESOLVED_PATH);
+ if (!client)
+ DBG("Failed to initialize proxy for systemd-resolved");
+ else {
+ resolved_proxy = g_dbus_proxy_new(client, SYSTEMD_RESOLVED_PATH,
+ "org.freedesktop.resolve1.Manager");
+
+ if (resolved_proxy) {
+ /* setup succeeded, disable dnsproxy */
+ dnsproxy = FALSE;
+ }
+ else
+ DBG("Failed to initialize proxy for systemd-resolved");
+ }
+ }
+ }
/* get autoip nameservers */
ns = __connman_inet_get_pnp_nameservers(NULL);
@@ -706,4 +905,19 @@ void __connman_resolver_cleanup(void)
g_slist_free(entry_list);
entry_list = NULL;
}
+
+ if (resolved_proxy) {
+ g_dbus_proxy_unref(resolved_proxy);
+ resolved_proxy = NULL;
+ }
+
+ if (client) {
+ g_dbus_client_unref(client);
+ client = NULL;
+ }
+
+ if (connection) {
+ dbus_connection_unref(connection);
+ connection = NULL;
+ }
}
--
2.13.5
3 years, 3 months
[PATCH v2] gsupplicant: Updates to handling of security change
by Harish Jenny K N
Changing of security type of one BSS is resulting in removing of
GSupplicantNetwork and other BSSs objects in the group.
The corresponding entries for other BSS in the same group are not
removed in other hash tables like bss_mapping and interface->bss_mapping.
This commit only deletes the network when there is a single entry in
network->bss_table during change in security for one bss.
This commit also avoids accessing any deleted bss object when reply
is got from async dbus call, by deleting any pending dbus calls
associated with the bss object.
---
gsupplicant/supplicant.c | 48 +++++++++++++++++++++++++++++++-----------------
1 file changed, 31 insertions(+), 17 deletions(-)
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 4f79012..5aa6e29 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -755,6 +755,8 @@ static void remove_bss(gpointer data)
{
struct g_supplicant_bss *bss = data;
+ supplicant_dbus_property_call_cancel_all(bss);
+
g_free(bss->path);
g_free(bss);
}
@@ -2064,7 +2066,7 @@ static void interface_bss_added_without_keys(DBusMessageIter *iter,
supplicant_dbus_property_get_all(bss->path,
SUPPLICANT_INTERFACE ".BSS",
- bss_property, bss, NULL);
+ bss_property, bss, bss);
bss_compute_security(bss);
if (add_or_replace_bss_to_network(bss) < 0)
@@ -2747,18 +2749,16 @@ static void signal_bss_changed(const char *path, DBusMessageIter *iter)
if (old_security != bss->security) {
struct g_supplicant_bss *new_bss;
- SUPPLICANT_DBG("New network security for %s", bss->ssid);
+ SUPPLICANT_DBG("New network security for %s with path %s",
+ bss->ssid, bss->path);
/* Security change policy:
- * - we first copy the current bss into a new one with
+ * - We first copy the current bss into a new one with
* its own pointer (path)
- * - we remove the current bss related network which will
- * tell the plugin about such removal. This is done due
- * to the fact that a security change means a group change
- * so a complete network change.
- * (current bss becomes invalid as well)
- * - we add the new bss: it adds new network and tell the
- * plugin about it. */
+ * - Clear the old bss pointer and remove the network completely
+ * if there are no more BSSs in the bss table.
+ * - The new bss will be added either to an existing network
+ * or an additional network will be created */
new_bss = g_try_new0(struct g_supplicant_bss, 1);
if (!new_bss)
@@ -2767,15 +2767,29 @@ static void signal_bss_changed(const char *path, DBusMessageIter *iter)
memcpy(new_bss, bss, sizeof(struct g_supplicant_bss));
new_bss->path = g_strdup(bss->path);
- g_hash_table_remove(interface->network_table, network->group);
+ if (network->best_bss == bss) {
+ network->best_bss = NULL;
+ network->signal = BSS_UNKNOWN_STRENGTH;
+ }
+
+ g_hash_table_remove(bss_mapping, path);
+
+ g_hash_table_remove(interface->bss_mapping, path);
+ g_hash_table_remove(network->bss_table, path);
+
+ update_network_signal(network);
+
+ if (g_hash_table_size(network->bss_table) == 0)
+ g_hash_table_remove(interface->network_table,
+ network->group);
if (add_or_replace_bss_to_network(new_bss) < 0) {
- /* Remove entries in hash tables to handle the
- * failure in add_or_replace_bss_to_network
- */
- g_hash_table_remove(bss_mapping, path);
- g_hash_table_remove(interface->bss_mapping, path);
- g_hash_table_remove(network->bss_table, path);
+ /* Prevent a memory leak on failure in
+ * add_or_replace_bss_to_network */
+ SUPPLICANT_DBG("Failed to add bss %s to network table",
+ new_bss->path);
+ g_free(new_bss->path);
+ g_free(new_bss);
}
return;
--
1.9.1
3 years, 3 months
Fw: Re: Connman coredump
by Cliff McDiarmid
Sent: Tuesday, September 26, 2017 at 8:18 PM
From: "Cliff McDiarmid" <cliffhanger(a)gardener.com>
To: "Daniel Wagner" <wagi(a)monom.org>
Subject: Re: Connman coredump
Sent: Monday, September 25, 2017 at 8:20 PM
From: "Daniel Wagner" <wagi(a)monom.org>
To: "Cliff McDiarmid" <cliffhanger(a)gardener.com>, connman(a)lists.01.org
Subject: Re: Connman coredump
>connmand[3059]: src/stats.c:__connman_stats_update() ring buffer is full, update history file
>When the buffer is full, ConnMan creates a summary and adds it
>to the history file.
>connmand[3059]: src/stats.c:stats_file_remap() file 0x7ffe2ee42090 size 4096
>addr (nil) len 0
>So this looks still okay. The first remap is the history file open (empty
>.file), the secon remap is a the temporay new history file (also empty).
>(connmand:3059): GLib-CRITICAL **: g_date_set_time_t: assertion
>g_date_valid_dmy (date->day, date->month, date->year)' failed
>Since the first glib message is about g_data_set_time_t(), it could be that
>glib is not happy with the timezone settings.
>https://developer.gnome.org/glib/stable/glib-Date-and-Time-Functions.html...
>g_data_set_time_t() calls g_date_valid_dmy eventually which is pretty unhappy:
>/**
>* g_date_valid_dmy:
>@day: day
>* @month: month
>* @year: year
>*
>* Returns %TRUE if the day-month-year triplet forms a valid, existing day
>* in the range of days #GDate understands (Year 1 or later, no more than
>* a few thousand years in the future).
>*
>* Returns: %TRUE if the date is a valid one
>*/
>gboolean
>g_date_valid_dmy (GDateDay d,
>GDateMonth m,
>GDateYear y)
>{
>return ( (m > G_DATE_BAD_MONTH) &&
>(m < 13) &&
>(d > G_DATE_BAD_DAY) &&
>(y > G_DATE_BAD_YEAR) && /* must check before using g_date_is_leap_year */
>(d <= (g_date_is_leap_year (y) ?
>days_in_months[1][m] : days_in_months[0][m])) );
>}
>Can you check if your time settings are correct on your platform?
Thanks Daniel for the advice. My time and zone settings look okay:
'timedatectl status' gives
Local time: Tue 2017-09-26 19:30:34 BST
Universal time: Tue 2017-09-26 18:30:34 UTC
RTC time: Tue 2017-09-26 18:30:34
Time zone: Europe/London (BST, +0100)
Network time on: no
NTP synchronized: no
RTC in local TZ: no
Is it possible that this is a bug and ugrading Gilb might help?
Connman has been a breeze to run in the past. This IS my first 64bit system.
Cliff
3 years, 3 months
[PATCH] gsupplicant: Updates to handling of security change
by Harish Jenny K N
Changing of security type of one BSS is resulting in removing of
GSupplicantNetwork and other BSSs objects in the group.
The corresponding entries for other BSS in the same group are not
removed in other hash tables like bss_mapping and interface->bss_mapping.
This commit only deletes the network when there is a single entry in
network->bss_table during change in security for one bss.
This commit also avoids accessing any deleted bss object when reply
is got from async dbus call, by deleting any pending dbus calls
associated with the bss object.
---
gsupplicant/supplicant.c | 40 +++++++++++++++++++++++++++++++---------
1 file changed, 31 insertions(+), 9 deletions(-)
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 4f79012..7d42404 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -755,6 +755,8 @@ static void remove_bss(gpointer data)
{
struct g_supplicant_bss *bss = data;
+ supplicant_dbus_property_call_cancel_all(bss);
+
g_free(bss->path);
g_free(bss);
}
@@ -2064,7 +2066,7 @@ static void interface_bss_added_without_keys(DBusMessageIter *iter,
supplicant_dbus_property_get_all(bss->path,
SUPPLICANT_INTERFACE ".BSS",
- bss_property, bss, NULL);
+ bss_property, bss, bss);
bss_compute_security(bss);
if (add_or_replace_bss_to_network(bss) < 0)
@@ -2747,7 +2749,8 @@ static void signal_bss_changed(const char *path, DBusMessageIter *iter)
if (old_security != bss->security) {
struct g_supplicant_bss *new_bss;
- SUPPLICANT_DBG("New network security for %s", bss->ssid);
+ SUPPLICANT_DBG("New network security for %s with path %s",
+ bss->ssid, bss->path);
/* Security change policy:
* - we first copy the current bss into a new one with
@@ -2767,15 +2770,34 @@ static void signal_bss_changed(const char *path, DBusMessageIter *iter)
memcpy(new_bss, bss, sizeof(struct g_supplicant_bss));
new_bss->path = g_strdup(bss->path);
- g_hash_table_remove(interface->network_table, network->group);
+ /* Clear the old bss pointer and remove the network completely
+ * if there are no more BSSs in the bss table. The new bss will
+ * be added either to an existing network or an additional
+ * network will be created */
+
+ if (network->best_bss == bss) {
+ network->best_bss = NULL;
+ network->signal = BSS_UNKNOWN_STRENGTH;
+ }
+
+ g_hash_table_remove(bss_mapping, path);
+
+ g_hash_table_remove(interface->bss_mapping, path);
+ g_hash_table_remove(network->bss_table, path);
+
+ update_network_signal(network);
+
+ if (g_hash_table_size(network->bss_table) == 0)
+ g_hash_table_remove(interface->network_table,
+ network->group);
if (add_or_replace_bss_to_network(new_bss) < 0) {
- /* Remove entries in hash tables to handle the
- * failure in add_or_replace_bss_to_network
- */
- g_hash_table_remove(bss_mapping, path);
- g_hash_table_remove(interface->bss_mapping, path);
- g_hash_table_remove(network->bss_table, path);
+ /* Prevent a memory leak on failure in
+ * add_or_replace_bss_to_network */
+ SUPPLICANT_DBG("Failed to add bss %s to network table",
+ new_bss->path);
+ g_free(new_bss->path);
+ g_free(new_bss);
}
return;
--
1.9.1
3 years, 3 months
Connman coredump
by Cliff McDiarmid
Sent: Tuesday, September 19, 2017 at 9:13 PM
From: "Daniel Wagner" <wagi(a)monom.org>
To: "Cliff McDiarmid" <cliffhanger(a)gardener.com>, connman(a)lists.01.org
Subject: Re: Connman coredump
Hi Cliff,
I think the last message was unreadable, I'm sending again.
On 09/17/2017 03:04 PM, Cliff McDiarmid wrote:
> Hi
>
> Must apologize for other unconnected emails that have dropped in
> forum. Still trying to figure how that occured.
>
> I've been using Connman for about three years and have had nothing
> but success.
That nice to hear :)
> But I've just installed into a Gnome3 64bit systemd system. I'm
> now experiencing dumps every five minutes or so,
>Do you happen to get a stack trace?
No
> after restarting the
> connection, into /var/lib/connman. These consist of sizable files
> labelled 'stats-918J6Y', as an example, of up to a gig in size.
> There is nothing obvious from the journal log, but maybe the following?
>Is there something in the connman log (journald -u connman.service)? If
>not you could also start connman with the debug option and not in the
>background (-d -n); that is without systemd.
Started Connman manually from the command line with debug option with the output to a log file.
it crashed and produced a 'stats' file. It needs someone clever than me to interpret it.
The log file is attached.
thanks Daniel
3 years, 3 months
[PATCH] ethernet: Fixed memory leak when adding network to device fails
by Saurav Babu
ifname is allocated memory by connman_inet_ifname() but it is never
freed when function fails to add network to device
Signed-off-by: Saurav Babu <saurav.babu(a)samsung.com>
---
plugins/ethernet.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/ethernet.c b/plugins/ethernet.c
index 9a4d741..935c967 100644
--- a/plugins/ethernet.c
+++ b/plugins/ethernet.c
@@ -187,6 +187,7 @@ static void add_network(struct connman_device *device,
if (connman_device_add_network(device, network) < 0) {
connman_network_unref(network);
+ g_free(ifname);
return;
}
--
1.9.1
3 years, 3 months