From 0b3fdd073e8665f04f480cda50df7b11955bfd80 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 6 Jan 2014 16:20:48 -0600 Subject: [PATCH] ifcfg-rh: fix handling of DHCP_SEND_HOSTNAME when no hostname is given Move DHCP_SEND_HOSTNAME parsing out of the check for DHCP_HOSTNAME so that users can disable NM sending the system hostname to the DHCP server when DHCP_HOSTNAME is not defined. --- src/settings/plugins/ifcfg-rh/reader.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 2c808cf1f5..1650b84311 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -1365,13 +1365,14 @@ make_ip4_setting (shvarFile *ifcfg, if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { value = svGetValue (ifcfg, "DHCP_HOSTNAME", FALSE); if (value && strlen (value)) - g_object_set (s_ip4, - NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, value, - NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, - svTrueValue (ifcfg, "DHCP_SEND_HOSTNAME", TRUE), - NULL); + g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, value, NULL); g_free (value); + g_object_set (s_ip4, + NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, + svTrueValue (ifcfg, "DHCP_SEND_HOSTNAME", TRUE), + NULL); + value = svGetValue (ifcfg, "DHCP_CLIENT_ID", FALSE); if (value && strlen (value)) g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, value, NULL);