/* ---ifcfg-rh---
* property: dhcp-hostname
* variable: DHCP_HOSTNAME
- * description: Hostname to send to the DHCP server.
+ * description: Hostname to send to the DHCP server. When both DHCP_HOSTNAME and
+ * DHCP_FQDN are specified only the latter is used.
* ---end---
*/
*
* Since: 1.2
*/
+ /* ---ifcfg-rh---
+ * property: dhcp-fqdn
+ * variable: DHCP_FQDN
+ * description: FQDN to send to the DHCP server. When both DHCP_HOSTNAME and
+ * DHCP_FQDN are specified only the latter is used.
+ * example: DHCP_FQDN=foo.bar.com
+ * ---end---
+ */
g_object_class_install_property
(object_class, PROP_DHCP_FQDN,
g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_FQDN, "", "",
/* Handle DHCP settings */
if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) {
value = svGetValue (ifcfg, "DHCP_HOSTNAME", FALSE);
- if (value && strlen (value))
+ if (value && *value)
g_object_set (s_ip4, NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, value, NULL);
g_free (value);
+ value = svGetValue (ifcfg, "DHCP_FQDN", FALSE);
+ if (value && *value) {
+ g_object_set (s_ip4,
+ NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, NULL,
+ NM_SETTING_IP4_CONFIG_DHCP_FQDN, value,
+ NULL);
+ }
+ g_free (value);
+
g_object_set (s_ip4,
NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, svGetValueBoolean (ifcfg, "DHCP_SEND_HOSTNAME", TRUE),
NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT, svGetValueInt64 (ifcfg, "IPV4_DHCP_TIMEOUT", 10, 0, G_MAXUINT32, 0),
if (value)
svSetValue (ifcfg, "DHCP_HOSTNAME", value, FALSE);
+ value = nm_setting_ip4_config_get_dhcp_fqdn (NM_SETTING_IP4_CONFIG (s_ip4));
+ if (value)
+ svSetValue (ifcfg, "DHCP_FQDN", value, FALSE);
+
/* Missing DHCP_SEND_HOSTNAME means TRUE, and we prefer not write it explicitly
* in that case, because it is NM-specific variable
*/
if (!utils_ignore_ip_config (connection)) {
svSetValue (ifcfg, "DHCP_HOSTNAME", NULL, FALSE);
+ svSetValue (ifcfg, "DHCP_FQDN", NULL, FALSE);
if (!write_ip4_setting (connection, ifcfg, error))
goto out;