summaryrefslogtreecommitdiff
path: root/src/nss-mymachines/nss-mymachines.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-16 03:30:40 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-16 03:30:40 +0200
commit555bd6e95bf2b469306d9cd86e126c0122d0895b (patch)
tree35d4e4e872117f8b93da53994f47aea01817175a /src/nss-mymachines/nss-mymachines.c
parent1fa65c593c6d2fbafe9d0f7caa6eb1c8034da2e0 (diff)
nss: various minor fixes to nss-myhostname + nss-mymachines
Diffstat (limited to 'src/nss-mymachines/nss-mymachines.c')
-rw-r--r--src/nss-mymachines/nss-mymachines.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c
index 2d3e54210c..5327499957 100644
--- a/src/nss-mymachines/nss-mymachines.c
+++ b/src/nss-mymachines/nss-mymachines.c
@@ -131,7 +131,7 @@ enum nss_status _nss_mymachines_gethostbyname4_r(
goto fail;
if (c <= 0) {
- *errnop = ENOENT;
+ *errnop = ESRCH;
*h_errnop = HOST_NOT_FOUND;
return NSS_STATUS_NOTFOUND;
}
@@ -140,7 +140,7 @@ enum nss_status _nss_mymachines_gethostbyname4_r(
ms = ALIGN(l+1) + ALIGN(sizeof(struct gaih_addrtuple)) * c;
if (buflen < ms) {
*errnop = ENOMEM;
- *h_errnop = NO_RECOVERY;
+ *h_errnop = TRY_AGAIN;
return NSS_STATUS_TRYAGAIN;
}
@@ -168,6 +168,11 @@ enum nss_status _nss_mymachines_gethostbyname4_r(
if (r < 0)
goto fail;
+ if (!IN_SET(family, AF_INET, AF_INET6)) {
+ r = -EAFNOSUPPORT;
+ goto fail;
+ }
+
if (sz != PROTO_ADDRESS_SIZE(family)) {
r = -EINVAL;
goto fail;