diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2016-03-11 18:05:31 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2016-03-11 18:05:31 +0100 |
commit | 25b5f766ed8d1213ad10238a2e8e9fed1a5cd10f (patch) | |
tree | f4db8670ccc1a20d4072c3812bf95d21c6911468 | |
parent | 28d6fbec1d58d49e77c97237d1c0182872209907 (diff) | |
download | network-manager-applet-25b5f766ed8d1213ad10238a2e8e9fed1a5cd10f.tar.gz |
info-dialog: don't try to process ipv4 settings where there are none
Who uses IPv4 anyway?
-rw-r--r-- | src/applet-dialogs.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c index ff5b1bd4..a3281bb9 100644 --- a/src/applet-dialogs.c +++ b/src/applet-dialogs.c @@ -620,14 +620,20 @@ info_dialog_add_page (GtkNotebook *notebook, row++; ip4_config = nm_device_get_ip4_config (device); - addresses = nm_ip_config_get_addresses (ip4_config); + if (ip4_config) { + addresses = nm_ip_config_get_addresses (ip4_config); + gateway = nm_ip_config_get_gateway (ip4_config); + } else { + addresses = NULL; + gateway = NULL; + } + if (addresses && addresses->len > 0) def_addr = (NMIPAddress *) g_ptr_array_index (addresses, 0); display_ip4_info (def_addr, addresses, grid, &row); /* Gateway */ - gateway = nm_ip_config_get_gateway (ip4_config); if (gateway && *gateway) { desc_widget = create_info_label (_("Default Route:"), FALSE); desc_object = gtk_widget_get_accessible (desc_widget); @@ -667,13 +673,18 @@ info_dialog_add_page (GtkNotebook *notebook, ip6_config = nm_device_get_ip6_config (device); if (ip6_config) { addresses = nm_ip_config_get_addresses (ip6_config); - if (addresses && addresses->len > 0) - def6_addr = (NMIPAddress *) g_ptr_array_index (addresses, 0); + gateway = nm_ip_config_get_gateway (ip6_config); + } else { + addresses = NULL; + gateway = NULL; } + + if (addresses && addresses->len > 0) + def6_addr = (NMIPAddress *) g_ptr_array_index (addresses, 0); + display_ip6_info (def6_addr, addresses, method, grid, &row); /* Gateway */ - gateway = nm_ip_config_get_gateway (ip6_config); if (gateway && *gateway) { desc_widget = create_info_label (_("Default Route:"), FALSE); desc_object = gtk_widget_get_accessible (desc_widget); |