summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-05-02 11:35:07 +0200
committerThomas Haller <thaller@redhat.com>2023-05-02 11:40:34 +0200
commit601605dbea6ef68553e50b4ad609e28edbf9f142 (patch)
treee8330d49b44fc1c1ccf8d2dab02d38f4cda88470
parentb4338de9844d5b80b0df3b8f95d61fb8b1af639b (diff)
downloadNetworkManager-601605dbea6ef68553e50b4ad609e28edbf9f142.tar.gz
dns: use NM_STR_HAS_SUFFIX() instead of g_str_has_suffix()
It translates to a plain memcmp() as the argument is a string literal.
-rw-r--r--src/core/dns/nm-dns-manager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/dns/nm-dns-manager.c b/src/core/dns/nm-dns-manager.c
index d321379ae0..34c561e323 100644
--- a/src/core/dns/nm-dns-manager.c
+++ b/src/core/dns/nm-dns-manager.c
@@ -2128,7 +2128,8 @@ nm_dns_manager_set_hostname(NMDnsManager *self, const char *hostname, gboolean s
/* Certain hostnames we don't want to include in resolv.conf 'searches' */
if (hostname && nm_utils_is_specific_hostname(hostname)
- && !g_str_has_suffix(hostname, ".in-addr.arpa") && !nm_inet_is_valid(AF_UNSPEC, hostname)) {
+ && !NM_STR_HAS_SUFFIX(hostname, ".in-addr.arpa")
+ && !nm_inet_is_valid(AF_UNSPEC, hostname)) {
domain = strchr(hostname, '.');
if (domain) {
domain++;