From d979ee01b51c5e53cd38228659ff67c780f7efe4 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Sun, 15 Apr 2012 03:01:57 +0100 Subject: connman-gnome: connman 0.79 API fixes Fix connman-gnome to work with connman 0.79, which made a number of fairly serious DBus API changes. Also switch over to the newly repopulated git repo on kernel.org in which the two previous patches have been merged. Fixes [YOCTO #2202]. (From OE-Core rev: 82744f56f8bfbdcc303034dee3d6e188cf8180b1) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- .../0003-Fix-setting-IPv4-configuration.patch | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 meta/recipes-connectivity/connman/connman-gnome/0003-Fix-setting-IPv4-configuration.patch (limited to 'meta/recipes-connectivity/connman/connman-gnome/0003-Fix-setting-IPv4-configuration.patch') diff --git a/meta/recipes-connectivity/connman/connman-gnome/0003-Fix-setting-IPv4-configuration.patch b/meta/recipes-connectivity/connman/connman-gnome/0003-Fix-setting-IPv4-configuration.patch new file mode 100644 index 0000000000..a25ffd9cfa --- /dev/null +++ b/meta/recipes-connectivity/connman/connman-gnome/0003-Fix-setting-IPv4-configuration.patch @@ -0,0 +1,85 @@ +From 8594fb5e2fc347984457e2e46b175eb3cf57951f Mon Sep 17 00:00:00 2001 +Message-Id: <8594fb5e2fc347984457e2e46b175eb3cf57951f.1334369310.git.paul.eggleton@linux.intel.com> +In-Reply-To: +References: +From: Paul Eggleton +Date: Sat, 14 Apr 2012 01:11:53 +0100 +Subject: [PATCH 3/6] Fix setting IPv4 configuration + +Values in the hashtable for IPv4.Configuration need to be variants, not +strings, and don't pass address entries if the method is dhcp. + +Upstream-Status: Submitted + +Signed-off-by: Paul Eggleton +--- + common/connman-client.c | 32 +++++++++++++++++++++++++------- + 1 files changed, 25 insertions(+), 7 deletions(-) + +diff --git a/common/connman-client.c b/common/connman-client.c +index 9d755c4..e4441ad 100644 +--- a/common/connman-client.c ++++ b/common/connman-client.c +@@ -39,6 +39,11 @@ + #define CONNMAN_CLIENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ + CONNMAN_TYPE_CLIENT, ConnmanClientPrivate)) + ++#ifndef DBUS_TYPE_G_DICTIONARY ++#define DBUS_TYPE_G_DICTIONARY \ ++ (dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) ++#endif ++ + typedef struct _ConnmanClientPrivate ConnmanClientPrivate; + + struct _ConnmanClientPrivate { +@@ -248,6 +253,16 @@ GtkTreeModel *connman_client_get_device_model(ConnmanClient *client) + return model; + } + ++void hash_table_value_string_insert( GHashTable *hash, gpointer key, const char *str ) ++{ ++ GValue *itemvalue; ++ ++ itemvalue = g_slice_new0(GValue); ++ g_value_init(itemvalue, G_TYPE_STRING); ++ g_value_set_string(itemvalue, str); ++ g_hash_table_insert(hash, key, itemvalue); ++} ++ + gboolean connman_client_set_ipv4(ConnmanClient *client, const gchar *device, + struct ipv4_config *ipv4_config) + { +@@ -255,12 +270,7 @@ gboolean connman_client_set_ipv4(ConnmanClient *client, const gchar *device, + DBusGProxy *proxy; + GValue value = { 0 }; + gboolean ret; +- GHashTable *ipv4 = g_hash_table_new(g_str_hash, g_str_equal); +- +- g_hash_table_insert(ipv4, "Method", (gpointer)ipv4_config->method); +- g_hash_table_insert(ipv4, "Address", (gpointer)ipv4_config->address); +- g_hash_table_insert(ipv4, "Netmask", (gpointer)ipv4_config->netmask); +- g_hash_table_insert(ipv4, "Gateway", (gpointer)ipv4_config->gateway); ++ GHashTable *ipv4 = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); + + DBG("client %p", client); + +@@ -270,7 +280,15 @@ gboolean connman_client_set_ipv4(ConnmanClient *client, const gchar *device, + proxy = connman_dbus_get_proxy(priv->store, device); + if (proxy == NULL) + return FALSE; +- g_value_init(&value, DBUS_TYPE_G_STRING_STRING_HASHTABLE); ++ ++ hash_table_value_string_insert(ipv4, "Method", ipv4_config->method); ++ if( g_strcmp0(ipv4_config->method, "dhcp" ) != 0 ) { ++ hash_table_value_string_insert(ipv4, "Address", ipv4_config->address); ++ hash_table_value_string_insert(ipv4, "Netmask", ipv4_config->netmask); ++ hash_table_value_string_insert(ipv4, "Gateway", ipv4_config->gateway); ++ } ++ ++ g_value_init(&value, DBUS_TYPE_G_DICTIONARY); + g_value_set_boxed(&value, ipv4); + ret = connman_set_property(proxy, "IPv4.Configuration", &value, NULL); + +-- +1.7.5.4 + -- cgit v1.2.3-54-g00ecf