summaryrefslogtreecommitdiff
path: root/src/nss-myhostname
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-04 01:41:12 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-04 01:42:42 +0100
commit1d050e1e0a7082e23ee9b31fa0b819cb332b3444 (patch)
tree7545997688bd7b7e3a34e4f580d306347eb8a037 /src/nss-myhostname
parentd2df88ffbac8858214adb9daaf7a93122fe26a50 (diff)
rtnl: when querying local addresses and gateways, take address family into account
Diffstat (limited to 'src/nss-myhostname')
-rw-r--r--src/nss-myhostname/nss-myhostname.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c
index 4a5bf759a9..aa92cc96e4 100644
--- a/src/nss-myhostname/nss-myhostname.c
+++ b/src/nss-myhostname/nss-myhostname.c
@@ -80,7 +80,7 @@ enum nss_status _nss_myhostname_gethostbyname4_r(
} else if (streq(name, "gateway")) {
- n_addresses = local_gateways(NULL, 0, &addresses);
+ n_addresses = local_gateways(NULL, 0, AF_UNSPEC, &addresses);
if (n_addresses <= 0) {
*errnop = ENOENT;
*h_errnop = HOST_NOT_FOUND;
@@ -104,7 +104,7 @@ enum nss_status _nss_myhostname_gethostbyname4_r(
return NSS_STATUS_NOTFOUND;
}
- n_addresses = local_addresses(NULL, 0, &addresses);
+ n_addresses = local_addresses(NULL, 0, AF_UNSPEC, &addresses);
if (n_addresses < 0)
n_addresses = 0;
@@ -350,7 +350,7 @@ enum nss_status _nss_myhostname_gethostbyname3_r(
} else if (streq(name, "gateway")) {
- n_addresses = local_gateways(NULL, af, &addresses);
+ n_addresses = local_gateways(NULL, 0, af, &addresses);
if (n_addresses <= 0) {
*errnop = ENOENT;
*h_errnop = HOST_NOT_FOUND;
@@ -373,7 +373,7 @@ enum nss_status _nss_myhostname_gethostbyname3_r(
return NSS_STATUS_NOTFOUND;
}
- n_addresses = local_addresses(NULL, af, &addresses);
+ n_addresses = local_addresses(NULL, 0, af, &addresses);
if (n_addresses < 0)
n_addresses = 0;
@@ -449,7 +449,7 @@ enum nss_status _nss_myhostname_gethostbyaddr2_r(
}
- n_addresses = local_addresses(NULL, 0, &addresses);
+ n_addresses = local_addresses(NULL, 0, AF_UNSPEC, &addresses);
if (n_addresses > 0) {
for (a = addresses, n = 0; (int) n < n_addresses; n++, a++) {
if (af != a->family)
@@ -473,7 +473,7 @@ enum nss_status _nss_myhostname_gethostbyaddr2_r(
free(addresses);
addresses = NULL;
- n_addresses = local_gateways(NULL, 0, &addresses);
+ n_addresses = local_gateways(NULL, 0, AF_UNSPEC, &addresses);
if (n_addresses > 0) {
for (a = addresses, n = 0; (int) n < n_addresses; n++, a++) {
if (af != a->family)