+2004-08-15 Ulrich Drepper <drepper@redhat.com>
+
+ * nss/getent.c: Allow queries for getaddrinfo with AF_INET and
+ AF_INET6.
+
2004-08-14 Ulrich Drepper <drepper@redhat.com>
* po/de.po: Update from translation team.
/* This is for hosts, but using getaddrinfo */
static int
-ahosts_keys (int number, char *key[])
+ahosts_keys_int (int af, int xflags, int number, char *key[])
{
int result = 0;
int i;
struct addrinfo hint;
memset (&hint, '\0', sizeof (hint));
- hint.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME;
- hint.ai_family = AF_UNSPEC;
+ hint.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME | xflags;
+ hint.ai_family = af;
for (i = 0; i < number; ++i)
{
return result;
}
+static int
+ahosts_keys (int number, char *key[])
+{
+ return ahosts_keys_int (AF_UNSPEC, 0, number, key);
+}
+
+static int
+ahostsv4_keys (int number, char *key[])
+{
+ return ahosts_keys_int (AF_INET, 0, number, key);
+}
+
+static int
+ahostsv6_keys (int number, char *key[])
+{
+ return ahosts_keys_int (AF_INET6, AI_V4MAPPED, number, key);
+}
+
/* This is for netgroup */
static int
netgroup_keys (int number, char *key[])
{
#define D(name) { #name, name ## _keys },
D(ahosts)
+D(ahostsv4)
+D(ahostsv6)
D(aliases)
D(ethers)
D(group)