mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-06 03:30:31 +01:00
all: use nm_hostname_is_valid() instead of systemd code
This commit is contained in:
parent
9ff1f66680
commit
c4f5111920
4 changed files with 5 additions and 8 deletions
|
|
@ -1080,7 +1080,7 @@ config_init(NMDhcpClientConfig *config, const NMDhcpClientConfig *src)
|
|||
if (!config->send_hostname) {
|
||||
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))) {
|
||||
|| (!config->use_fqdn && !nm_hostname_is_valid(config->hostname, FALSE))) {
|
||||
nm_log_warn(LOGD_DHCP,
|
||||
"dhcp%c: %s '%s' is invalid, will be ignored",
|
||||
nm_utils_addr_family_to_char(config->addr_family),
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "libnm-core-intern/nm-core-internal.h"
|
||||
#include "libnm-glib-aux/nm-str-buf.h"
|
||||
#include "libnm-systemd-shared/nm-sd-utils-shared.h"
|
||||
|
||||
#include "NetworkManagerUtils.h"
|
||||
#include "devices/nm-device.h"
|
||||
|
|
@ -2104,7 +2103,7 @@ nm_dns_manager_set_hostname(NMDnsManager *self, const char *hostname, gboolean s
|
|||
domain = hostname;
|
||||
}
|
||||
|
||||
if (!nm_sd_hostname_is_valid(domain, FALSE))
|
||||
if (!nm_hostname_is_valid(domain, FALSE))
|
||||
domain = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include "libnm-glib-aux/nm-secret-utils.h"
|
||||
#include "libnm-glib-aux/nm-time-utils.h"
|
||||
#include "libnm-glib-aux/nm-str-buf.h"
|
||||
#include "libnm-systemd-shared/nm-sd-utils-shared.h"
|
||||
#include "nm-utils.h"
|
||||
#include "libnm-core-intern/nm-core-internal.h"
|
||||
#include "nm-setting-connection.h"
|
||||
|
|
@ -5239,7 +5238,7 @@ nm_utils_shorten_hostname(const char *hostname, char **shortened)
|
|||
nm_assert(hostname);
|
||||
nm_assert(shortened);
|
||||
|
||||
if (nm_sd_hostname_is_valid(hostname, FALSE)) {
|
||||
if (nm_hostname_is_valid(hostname, FALSE)) {
|
||||
*shortened = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -5253,7 +5252,7 @@ nm_utils_shorten_hostname(const char *hostname, char **shortened)
|
|||
|
||||
s = g_strndup(hostname, l);
|
||||
|
||||
if (!nm_sd_hostname_is_valid(s, FALSE)) {
|
||||
if (!nm_hostname_is_valid(s, FALSE)) {
|
||||
*shortened = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
#include "libnm-log-core/nm-logging.h"
|
||||
#include "libnm-core-intern/nm-core-internal.h"
|
||||
#include "nm-initrd-generator.h"
|
||||
#include "libnm-systemd-shared/nm-sd-utils-shared.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
@ -586,7 +585,7 @@ reader_parse_ip(Reader *reader, const char *sysfs_dir, char *argument)
|
|||
}
|
||||
}
|
||||
|
||||
if (client_hostname && !nm_sd_hostname_is_valid(client_hostname, FALSE))
|
||||
if (client_hostname && !nm_hostname_is_valid(client_hostname, FALSE))
|
||||
client_hostname = NULL;
|
||||
|
||||
if (client_hostname) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue