summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-08-16 20:38:32 +0200
committerTom Gundersen <teg@jklm.no>2015-08-16 20:38:32 +0200
commit3aeae8766468de0c1583075bb31cf06e66a1e42e (patch)
treeee289e3642002dddffc241df22ebb0460b3dac02
parent53576a701043f65423a14c84c0b978abc2cd09fa (diff)
parentf43242886cae3daf0474134175707cbc02c05191 (diff)
Merge pull request #954 from poettering/nss-myhostname-loopback
nss-myhostname: use LOOPBACK_IFINDEX instead of if_nametoindex("lo")
-rw-r--r--src/nss-myhostname/nss-myhostname.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c
index ab96cb231e..69069cc75d 100644
--- a/src/nss-myhostname/nss-myhostname.c
+++ b/src/nss-myhostname/nss-myhostname.c
@@ -39,7 +39,6 @@
#define LOCALADDRESS_IPV4 (htonl(0x7F000002))
#define LOCALADDRESS_IPV6 &in6addr_loopback
-#define LOOPBACK_INTERFACE "lo"
NSS_GETHOSTBYNAME_PROTOTYPES(myhostname);
NSS_GETHOSTBYADDR_PROTOTYPES(myhostname);
@@ -117,7 +116,7 @@ enum nss_status _nss_myhostname_gethostbyname4_r(
}
/* If this call fails we fill in 0 as scope. Which is fine */
- lo_ifi = n_addresses <= 0 ? if_nametoindex(LOOPBACK_INTERFACE) : 0;
+ lo_ifi = n_addresses <= 0 ? LOOPBACK_IFINDEX : 0;
l = strlen(canonical);
ms = ALIGN(l+1) + ALIGN(sizeof(struct gaih_addrtuple)) * (n_addresses > 0 ? n_addresses : 2);