Drop compat "gateway" name
Back in 5248e7e1f1 (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.
This commit is contained in:
committed by
Lennart Poettering
parent
8374bf4fa2
commit
3c94f71472
@@ -212,20 +212,6 @@ bool is_localhost(const char *hostname) {
|
||||
endswith_no_case(hostname, ".localhost.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.")
|
||||
#if ENABLE_COMPAT_GATEWAY_HOSTNAME
|
||||
|| strcaseeq(hostname, "gateway") || strcaseeq(hostname, "gateway.")
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
int sethostname_idempotent(const char *s) {
|
||||
char buf[HOST_NAME_MAX + 1] = {};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user