return NSS_STATUS_NOTFOUND;
}
- canonical = "gateway";
+ canonical = "_gateway";
} else {
hn = gethostname_malloc();
l = strlen(canonical);
ms = ALIGN(l+1) + ALIGN(sizeof(struct gaih_addrtuple)) * (n_addresses > 0 ? n_addresses : 2);
if (buflen < ms) {
- *errnop = ENOMEM;
- *h_errnop = NO_RECOVERY;
+ *errnop = ERANGE;
+ *h_errnop = NETDB_INTERNAL;
return NSS_STATUS_TRYAGAIN;
}
c++;
l_canonical = strlen(canonical);
- l_additional = additional ? strlen(additional) : 0;
+ l_additional = strlen_ptr(additional);
ms = ALIGN(l_canonical+1)+
(additional ? ALIGN(l_additional+1) : 0) +
sizeof(char*) +
(c > 0 ? c+1 : 2) * sizeof(char*);
if (buflen < ms) {
- *errnop = ENOMEM;
- *h_errnop = NO_RECOVERY;
+ *errnop = ERANGE;
+ *h_errnop = NETDB_INTERNAL;
return NSS_STATUS_TRYAGAIN;
}
if (af == AF_UNSPEC)
af = AF_INET;
- if (af != AF_INET && af != AF_INET6) {
+ if (!IN_SET(af, AF_INET, AF_INET6)) {
*errnop = EAFNOSUPPORT;
*h_errnop = NO_DATA;
return NSS_STATUS_UNAVAIL;
return NSS_STATUS_NOTFOUND;
}
- canonical = "gateway";
+ canonical = "_gateway";
} else {
hn = gethostname_malloc();
continue;
if (memcmp(addr, &a->address, FAMILY_ADDRESS_SIZE(af)) == 0) {
- canonical = "gateway";
+ canonical = "_gateway";
goto found;
}
}