aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilia Ciobanu <emilia.maria.silvia.ciobanu@intel.com>2013-05-17 16:41:13 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-22 12:09:46 +0300
commitb1dfccdae7cb81b43f7dfc1e7db77108c559c3df (patch)
tree2b9f0ad36f7b38213e8b9e4d9cbe95b81dcfc264
parent8b8171237e9b3f1d0c360299efd1001368a3bf63 (diff)
downloadconnman-gnome-b1dfccdae7cb81b43f7dfc1e7db77108c559c3df.tar.gz
properties: Fix DHCP segfault
In networks that don't have a DHCP server configured, ipv4 address allocation fails and the ipv4 structure doesn't get populated. When the GUI is trying to read the ipv4_config.method field to see whether it contains "dhcp" string, a segmentation fault is generated. Ethernet manual configuration behavior remains unchanged after this fix.
-rw-r--r--properties/ethernet.c2
-rw-r--r--properties/wifi.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/properties/ethernet.c b/properties/ethernet.c
index 31db7a0..83b1535 100644
--- a/properties/ethernet.c
+++ b/properties/ethernet.c
@@ -194,7 +194,7 @@ void add_ethernet_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_d
data->button = button;
- if (g_str_equal(ipv4_config.method, "dhcp") == TRUE)
+ if (!ipv4_config.method || g_str_equal(ipv4_config.method, "dhcp") == TRUE)
update_ethernet_ipv4(data, CONNMAN_POLICY_DHCP);
else
update_ethernet_ipv4(data, CONNMAN_POLICY_MANUAL);
diff --git a/properties/wifi.c b/properties/wifi.c
index bd325ef..69cd6c3 100644
--- a/properties/wifi.c
+++ b/properties/wifi.c
@@ -230,7 +230,7 @@ static void wifi_ipconfig(GtkWidget *table, struct config_data *data, GtkTreeIte
data->ipv4_config = ipv4_config;
- if (g_str_equal(ipv4_config.method, "dhcp") == TRUE)
+ if (!ipv4_config.method || g_str_equal(ipv4_config.method, "dhcp") == TRUE)
update_wifi_ipv4(data, CONNMAN_POLICY_DHCP);
else
update_wifi_ipv4(data, CONNMAN_POLICY_MANUAL);