about summary refs log tree commit diff
path: root/nss
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-10-20 10:47:20 +0000
committerJakub Jelinek <jakub@redhat.com>2004-10-20 10:47:20 +0000
commit75c95410b7b80289663bf2ba828e84d2c7890369 (patch)
tree83f4b406b0d4d0a9bcf68f6c56feb00fc59406fa /nss
parente9e4030ae5f685547a9f7ead1362c7526aa88b80 (diff)
downloadglibc-75c95410b7b80289663bf2ba828e84d2c7890369.tar.gz
glibc-75c95410b7b80289663bf2ba828e84d2c7890369.tar.xz
glibc-75c95410b7b80289663bf2ba828e84d2c7890369.zip
Updated to fedora-glibc-20041018T0940
Diffstat (limited to 'nss')
-rw-r--r--nss/getent.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/nss/getent.c b/nss/getent.c
index f9f0a6e22a..c0a273241f 100644
--- a/nss/getent.c
+++ b/nss/getent.c
@@ -276,19 +276,12 @@ hosts_keys (int number, char *key[])
   for (i = 0; i < number; ++i)
     {
       struct hostent *host = NULL;
+      char addr[IN6ADDRSZ];
 
-      if (strchr (key[i], ':') != NULL)
-	{
-	  char addr[IN6ADDRSZ];
-	  if (inet_pton (AF_INET6, key[i], &addr))
-	    host = gethostbyaddr (addr, sizeof (addr), AF_INET6);
-	}
-      else if (isdigit (key[i][0]))
-	{
-	  char addr[INADDRSZ];
-	  if (inet_pton (AF_INET, key[i], &addr))
-	    host = gethostbyaddr (addr, sizeof (addr), AF_INET);
-	}
+      if (inet_pton (AF_INET6, key[i], &addr) > 0)
+	host = gethostbyaddr (addr, sizeof (addr), AF_INET6);
+      else if (inet_pton (AF_INET, key[i], &addr) > 0)
+	host = gethostbyaddr (addr, sizeof (addr), AF_INET);
       else if ((host = gethostbyname2 (key[i], AF_INET6)) == NULL)
 	host = gethostbyname2 (key[i], AF_INET);