diff options
Diffstat (limited to 'src/basic/hostname-util.c')
-rw-r--r-- | src/basic/hostname-util.c | 11 |
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] = {}; |