mirror of
https://github.com/systemd/systemd.git
synced 2025-02-09 13:57:42 +03:00
nss-myhostname: also recognize "gateway."
"gateway." skips adding the domain search path and saves some queries to the nameserver.
This commit is contained in:
parent
b42de08aa4
commit
df17ddee08
@ -78,7 +78,7 @@ enum nss_status _nss_myhostname_gethostbyname4_r(
|
||||
canonical = "localhost";
|
||||
local_address_ipv4 = htonl(INADDR_LOOPBACK);
|
||||
|
||||
} else if (streq(name, "gateway")) {
|
||||
} else if (streq(name, "gateway") || streq(name, "gateway.")) {
|
||||
|
||||
n_addresses = local_gateways(NULL, 0, AF_UNSPEC, &addresses);
|
||||
if (n_addresses <= 0) {
|
||||
@ -348,7 +348,7 @@ enum nss_status _nss_myhostname_gethostbyname3_r(
|
||||
canonical = "localhost";
|
||||
local_address_ipv4 = htonl(INADDR_LOOPBACK);
|
||||
|
||||
} else if (streq(name, "gateway")) {
|
||||
} else if (streq(name, "gateway") || streq(name, "gateway.")) {
|
||||
|
||||
n_addresses = local_gateways(NULL, 0, af, &addresses);
|
||||
if (n_addresses <= 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user