summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-ip4-config.c
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-07-09 11:26:02 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2019-11-28 17:56:35 +0100
commit1bde86396b1c98165460d7c884eb1828310052bf (patch)
tree6df99250066e896ed493c0243dbb85d8fb2bc87c /libnm-core/nm-setting-ip4-config.c
parenta0632c529b2158a851444732f5437e8465a8794f (diff)
downloadNetworkManager-1bde86396b1c98165460d7c884eb1828310052bf.tar.gz
libnm: add ipvx.dhcp-hostname-flags properties
When using the dhclient DHCP backend users can tweak the behavior in the dhclient configuration file. One of the options that was reported as useful in the past was the FQDN flags [1] [2]. Add native support for FQDN flags to NM by introducing new ipv{4,6}.dhcp-hostname-flags properties. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1684595 [2] https://bugzilla.redhat.com/show_bug.cgi?id=1255507
Diffstat (limited to 'libnm-core/nm-setting-ip4-config.c')
-rw-r--r--libnm-core/nm-setting-ip4-config.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libnm-core/nm-setting-ip4-config.c b/libnm-core/nm-setting-ip4-config.c
index c58ce65f9d..5f2a1b5a78 100644
--- a/libnm-core/nm-setting-ip4-config.c
+++ b/libnm-core/nm-setting-ip4-config.c
@@ -194,6 +194,18 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
+ if ( NM_FLAGS_ANY (nm_setting_ip_config_get_dhcp_hostname_flags (s_ip),
+ NM_DHCP_HOSTNAME_FLAGS_FQDN_MASK)
+ && !priv->dhcp_fqdn) {
+ /* Currently we send a FQDN option only when ipv4.dhcp-fqdn is set */
+ g_set_error_literal (error,
+ NM_CONNECTION_ERROR,
+ NM_CONNECTION_ERROR_INVALID_PROPERTY,
+ _("FQDN flags requires a FQDN set"));
+ g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DHCP_HOSTNAME_FLAGS);
+ return FALSE;
+ }
+
/* Failures from here on are NORMALIZABLE_ERROR... */
if ( nm_streq (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)