summaryrefslogtreecommitdiff
path: root/src/basic/hostname-util.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-08-21 15:26:45 +0200
committerTom Gundersen <teg@jklm.no>2015-08-21 15:26:45 +0200
commitef7051360aefca01d20f700ee74ac1baced59879 (patch)
tree7e74c19fc5928d35012d1ff99ddce20406cf92a6 /src/basic/hostname-util.c
parent6b8b67e7aed7d4f98881f823b89f5f4079e52066 (diff)
parent78c6a153c47f8d597c827bdcaf8c4e42ac87f738 (diff)
Merge pull request #1002 from poettering/resolved-various
resolved: synthesize more RRs locally and other fixes
Diffstat (limited to 'src/basic/hostname-util.c')
-rw-r--r--src/basic/hostname-util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/basic/hostname-util.c b/src/basic/hostname-util.c
index d901a5e82b..dc5434fcd1 100644
--- a/src/basic/hostname-util.c
+++ b/src/basic/hostname-util.c
@@ -151,6 +151,17 @@ bool is_localhost(const char *hostname) {
endswith_no_case(hostname, ".localdomain.");
}
+bool is_gateway_hostname(const char *hostname) {
+ assert(hostname);
+
+ /* This tries to identify the valid syntaxes for the our
+ * synthetic "gateway" host. */
+
+ return
+ strcaseeq(hostname, "gateway") ||
+ strcaseeq(hostname, "gateway.");
+}
+
int sethostname_idempotent(const char *s) {
char buf[HOST_NAME_MAX + 1] = {};