diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-12-04 01:41:12 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-12-04 01:42:42 +0100 |
commit | 1d050e1e0a7082e23ee9b31fa0b819cb332b3444 (patch) | |
tree | 7545997688bd7b7e3a34e4f580d306347eb8a037 /src/nss-myhostname | |
parent | d2df88ffbac8858214adb9daaf7a93122fe26a50 (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.c | 12 |
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) |