summaryrefslogtreecommitdiffstats
path: root/src/basic/hostname-util.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-12-10 11:10:54 +0100
committerLennart Poettering <lennart@poettering.net>2020-12-10 20:44:41 +0100
commit3c94f7147211ff8f913ddc41901ec5147872074e (patch)
tree4eebbf450a57a9c9ca3dffd8ae5a1570be89bea3 /src/basic/hostname-util.h
parentveritysetup: also place udev socket dep (diff)
downloadsystemd-3c94f7147211ff8f913ddc41901ec5147872074e.tar.xz
systemd-3c94f7147211ff8f913ddc41901ec5147872074e.zip
Drop compat "gateway" name
Back in 5248e7e1f11aba6859de0b28f0dd3778b22842f2 (July 2017) we moved over to "_gateway", with the old name declared to be temporary measure. Since we're doing a bunch of changes to resolved now, it seems to be a good moment to make this simplification and not add support for the compat name in new code.
Diffstat (limited to 'src/basic/hostname-util.h')
-rw-r--r--src/basic/hostname-util.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/basic/hostname-util.h b/src/basic/hostname-util.h
index c1e47a2a53..34819c2953 100644
--- a/src/basic/hostname-util.h
+++ b/src/basic/hostname-util.h
@@ -5,6 +5,7 @@
#include <stdio.h>
#include "macro.h"
+#include "strv.h"
bool hostname_is_set(void);
@@ -19,7 +20,11 @@ char* hostname_cleanup(char *s);
#define machine_name_is_valid(s) hostname_is_valid(s, false)
bool is_localhost(const char *hostname);
-bool is_gateway_hostname(const char *hostname);
+
+static inline bool is_gateway_hostname(const char *hostname) {
+ /* This tries to identify the valid syntaxes for the our synthetic "gateway" host. */
+ return STRCASE_IN_SET(hostname, "_gateway", "_gateway.");
+}
int sethostname_idempotent(const char *s);