network: Simplify helper function

This commit is contained in:
Robert Ancell 2019-10-18 15:03:20 +13:00 committed by Georges Basile Stavracas Neto
parent f03ae7ff93
commit 75b4e5e061
5 changed files with 18 additions and 25 deletions

View file

@ -143,15 +143,15 @@ add_details (GtkWidget *details, NMDevice *device, NMConnection *connection)
NMIPConfig *ip4_config = NULL;
NMIPConfig *ip6_config = NULL;
g_autofree gchar *ip4_address = NULL;
g_autofree gchar *ip4_route = NULL;
const gchar *ip4_route = NULL;
g_autofree gchar *ip4_dns = NULL;
g_autofree gchar *ip6_address = NULL;
gint i = 0;
ip4_config = nm_device_get_ip4_config (device);
if (ip4_config) {
ip4_address = panel_get_ip4_address_as_string (ip4_config, "address");
ip4_route = panel_get_ip4_address_as_string (ip4_config, "gateway");
ip4_address = panel_get_ip4_address_as_string (ip4_config);
ip4_route = nm_ip_config_get_gateway (ip4_config);
ip4_dns = panel_get_ip4_dns_as_string (ip4_config);
}
ip6_config = nm_device_get_ip6_config (device);