summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/connman/connman-gnome/0003-Fix-setting-IPv4-configuration.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/connman/connman-gnome/0003-Fix-setting-IPv4-configuration.patch')
-rw-r--r--meta/recipes-connectivity/connman/connman-gnome/0003-Fix-setting-IPv4-configuration.patch85
1 files changed, 0 insertions, 85 deletions
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
deleted file mode 100644
index a25ffd9cfa..0000000000
--- a/meta/recipes-connectivity/connman/connman-gnome/0003-Fix-setting-IPv4-configuration.patch
+++ /dev/null
@@ -1,85 +0,0 @@
1From 8594fb5e2fc347984457e2e46b175eb3cf57951f Mon Sep 17 00:00:00 2001
2Message-Id: <8594fb5e2fc347984457e2e46b175eb3cf57951f.1334369310.git.paul.eggleton@linux.intel.com>
3In-Reply-To: <cover.1334369310.git.paul.eggleton@linux.intel.com>
4References: <cover.1334369310.git.paul.eggleton@linux.intel.com>
5From: Paul Eggleton <paul.eggleton@linux.intel.com>
6Date: Sat, 14 Apr 2012 01:11:53 +0100
7Subject: [PATCH 3/6] Fix setting IPv4 configuration
8
9Values in the hashtable for IPv4.Configuration need to be variants, not
10strings, and don't pass address entries if the method is dhcp.
11
12Upstream-Status: Submitted
13
14Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
15---
16 common/connman-client.c | 32 +++++++++++++++++++++++++-------
17 1 files changed, 25 insertions(+), 7 deletions(-)
18
19diff --git a/common/connman-client.c b/common/connman-client.c
20index 9d755c4..e4441ad 100644
21--- a/common/connman-client.c
22+++ b/common/connman-client.c
23@@ -39,6 +39,11 @@
24 #define CONNMAN_CLIENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), \
25 CONNMAN_TYPE_CLIENT, ConnmanClientPrivate))
26
27+#ifndef DBUS_TYPE_G_DICTIONARY
28+#define DBUS_TYPE_G_DICTIONARY \
29+ (dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))
30+#endif
31+
32 typedef struct _ConnmanClientPrivate ConnmanClientPrivate;
33
34 struct _ConnmanClientPrivate {
35@@ -248,6 +253,16 @@ GtkTreeModel *connman_client_get_device_model(ConnmanClient *client)
36 return model;
37 }
38
39+void hash_table_value_string_insert( GHashTable *hash, gpointer key, const char *str )
40+{
41+ GValue *itemvalue;
42+
43+ itemvalue = g_slice_new0(GValue);
44+ g_value_init(itemvalue, G_TYPE_STRING);
45+ g_value_set_string(itemvalue, str);
46+ g_hash_table_insert(hash, key, itemvalue);
47+}
48+
49 gboolean connman_client_set_ipv4(ConnmanClient *client, const gchar *device,
50 struct ipv4_config *ipv4_config)
51 {
52@@ -255,12 +270,7 @@ gboolean connman_client_set_ipv4(ConnmanClient *client, const gchar *device,
53 DBusGProxy *proxy;
54 GValue value = { 0 };
55 gboolean ret;
56- GHashTable *ipv4 = g_hash_table_new(g_str_hash, g_str_equal);
57-
58- g_hash_table_insert(ipv4, "Method", (gpointer)ipv4_config->method);
59- g_hash_table_insert(ipv4, "Address", (gpointer)ipv4_config->address);
60- g_hash_table_insert(ipv4, "Netmask", (gpointer)ipv4_config->netmask);
61- g_hash_table_insert(ipv4, "Gateway", (gpointer)ipv4_config->gateway);
62+ GHashTable *ipv4 = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free);
63
64 DBG("client %p", client);
65
66@@ -270,7 +280,15 @@ gboolean connman_client_set_ipv4(ConnmanClient *client, const gchar *device,
67 proxy = connman_dbus_get_proxy(priv->store, device);
68 if (proxy == NULL)
69 return FALSE;
70- g_value_init(&value, DBUS_TYPE_G_STRING_STRING_HASHTABLE);
71+
72+ hash_table_value_string_insert(ipv4, "Method", ipv4_config->method);
73+ if( g_strcmp0(ipv4_config->method, "dhcp" ) != 0 ) {
74+ hash_table_value_string_insert(ipv4, "Address", ipv4_config->address);
75+ hash_table_value_string_insert(ipv4, "Netmask", ipv4_config->netmask);
76+ hash_table_value_string_insert(ipv4, "Gateway", ipv4_config->gateway);
77+ }
78+
79+ g_value_init(&value, DBUS_TYPE_G_DICTIONARY);
80 g_value_set_boxed(&value, ipv4);
81 ret = connman_set_property(proxy, "IPv4.Configuration", &value, NULL);
82
83--
841.7.5.4
85