summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2014-12-15 11:34:24 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-12-16 00:30:34 -0500
commitdf17ddee0853482bfaefc36b9bd3424a64621915 (patch)
tree05e604b07926bca669804a8c67a722f668b4fc10 /src
parentb42de08aa4c97636e42c28c7bce08f0d7c2a719a (diff)
nss-myhostname: also recognize "gateway."
"gateway." skips adding the domain search path and saves some queries to the nameserver.
Diffstat (limited to 'src')
-rw-r--r--src/nss-myhostname/nss-myhostname.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c
index aa92cc96e4..2f768603b0 100644
--- a/src/nss-myhostname/nss-myhostname.c
+++ b/src/nss-myhostname/nss-myhostname.c
@@ -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) {