summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-04-12 17:25:53 +0200
committerThomas Haller <thaller@redhat.com>2022-04-20 12:07:04 +0200
commitc4f51119208a424c080b1fbe332f8bcfa88454b5 (patch)
tree6075fd0f866985b5f98ca0d3e0fe9e558890de1a
parent9ff1f666809ad5b773eec826cd07735562e720bf (diff)
downloadNetworkManager-c4f51119208a424c080b1fbe332f8bcfa88454b5.tar.gz
all: use nm_hostname_is_valid() instead of systemd code
-rw-r--r--src/core/dhcp/nm-dhcp-client.c2
-rw-r--r--src/core/dns/nm-dns-manager.c3
-rw-r--r--src/core/nm-core-utils.c5
-rw-r--r--src/nm-initrd-generator/nmi-cmdline-reader.c3
4 files changed, 5 insertions, 8 deletions
diff --git a/src/core/dhcp/nm-dhcp-client.c b/src/core/dhcp/nm-dhcp-client.c
index 2bfd7e01eb..29eeae186a 100644
--- a/src/core/dhcp/nm-dhcp-client.c
+++ b/src/core/dhcp/nm-dhcp-client.c
@@ -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),
diff --git a/src/core/dns/nm-dns-manager.c b/src/core/dns/nm-dns-manager.c
index afda300bd2..1e54452aa4 100644
--- a/src/core/dns/nm-dns-manager.c
+++ b/src/core/dns/nm-dns-manager.c
@@ -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;
}
}
diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c
index c8b789b30a..085c806c12 100644
--- a/src/core/nm-core-utils.c
+++ b/src/core/nm-core-utils.c
@@ -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;
}
diff --git a/src/nm-initrd-generator/nmi-cmdline-reader.c b/src/nm-initrd-generator/nmi-cmdline-reader.c
index 412c751067..88760f7574 100644
--- a/src/nm-initrd-generator/nmi-cmdline-reader.c
+++ b/src/nm-initrd-generator/nmi-cmdline-reader.c
@@ -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) {