summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-01-06 16:20:48 -0600
committerDan Williams <dcbw@redhat.com>2014-01-06 16:20:48 -0600
commit0b3fdd073e8665f04f480cda50df7b11955bfd80 (patch)
treec37cd67bab243c527d2e047ce43e4240b2f784cb
parent91eafe95a3bfe1971a9c309c542d0e0182fb066e (diff)
downloadNetworkManager-0b3fdd073e8665f04f480cda50df7b11955bfd80.tar.gz
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.
-rw-r--r--src/settings/plugins/ifcfg-rh/reader.c11
1 files 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);