summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a71516d)
Check for RES_USE_INET6 before we prefer IPv6 over IPv4, for all our NSS
modules. (Not that the DNS resolver that is configured with this matters
to us, but hey, let's try to be compatible).
#include <nss.h>
#include <netdb.h>
#include <nss.h>
#include <netdb.h>
#define NSS_GETHOSTBYNAME_PROTOTYPES(module) \
enum nss_status _nss_##module##_gethostbyname4_r( \
#define NSS_GETHOSTBYNAME_PROTOTYPES(module) \
enum nss_status _nss_##module##_gethostbyname4_r( \
struct hostent *host, \
char *buffer, size_t buflen, \
int *errnop, int *h_errnop) { \
struct hostent *host, \
char *buffer, size_t buflen, \
int *errnop, int *h_errnop) { \
- return _nss_##module##_gethostbyname3_r( \
+ enum nss_status ret = NSS_STATUS_NOTFOUND; \
+ \
+ if (_res.options & RES_USE_INET6) \
+ ret = _nss_##module##_gethostbyname3_r( \
+ name, \
+ AF_INET6, \
+ host, \
+ buffer, buflen, \
+ errnop, h_errnop, \
+ NULL, \
+ NULL); \
+ if (ret == NSS_STATUS_NOTFOUND) \
+ ret = _nss_##module##_gethostbyname3_r( \
host, \
buffer, buflen, \
errnop, h_errnop, \
NULL, \
NULL); \
host, \
buffer, buflen, \
errnop, h_errnop, \
NULL, \
NULL); \
}
#define NSS_GETHOSTBYADDR_FALLBACKS(module) \
}
#define NSS_GETHOSTBYADDR_FALLBACKS(module) \