mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 10:08:05 +02:00
dhcp: honor the send_hostname property
This commit is contained in:
parent
32443ef3b5
commit
8d40d03a2c
1 changed files with 4 additions and 2 deletions
|
|
@ -1012,8 +1012,10 @@ config_init(NMDhcpClientConfig *config, const NMDhcpClientConfig *src)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->hostname) {
|
if (config->hostname) {
|
||||||
if ((config->use_fqdn && !nm_sd_dns_name_is_valid(config->hostname))
|
if (!config->send_hostname) {
|
||||||
|| (!config->use_fqdn && !nm_sd_hostname_is_valid(config->hostname, FALSE))) {
|
nm_clear_g_free((gpointer *) &config->hostname);
|
||||||
|
} else if ((config->use_fqdn && !nm_sd_dns_name_is_valid(config->hostname))
|
||||||
|
|| (!config->use_fqdn && !nm_sd_hostname_is_valid(config->hostname, FALSE))) {
|
||||||
nm_log_warn(LOGD_DHCP,
|
nm_log_warn(LOGD_DHCP,
|
||||||
"dhcp%c: %s '%s' is invalid, will be ignored",
|
"dhcp%c: %s '%s' is invalid, will be ignored",
|
||||||
nm_utils_addr_family_to_char(config->addr_family),
|
nm_utils_addr_family_to_char(config->addr_family),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue