gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31393 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r31393 - gnunet/src/util
Date: Sun, 15 Dec 2013 06:50:32 +0100

Author: LRN
Date: 2013-12-15 06:50:32 +0100 (Sun, 15 Dec 2013)
New Revision: 31393

Modified:
   gnunet/src/util/gnunet-service-resolver.c
Log:
Clean up dns resolver code a bit

To enable ipv6 resolution on W32 teredo must be enabled:
netsh interface teredo set state <enterpriseclient | client>

Modified: gnunet/src/util/gnunet-service-resolver.c
===================================================================
--- gnunet/src/util/gnunet-service-resolver.c   2013-12-15 01:56:00 UTC (rev 
31392)
+++ gnunet/src/util/gnunet-service-resolver.c   2013-12-15 05:50:32 UTC (rev 
31393)
@@ -275,12 +275,7 @@
   struct addrinfo *pos;
 
   memset (&hints, 0, sizeof (struct addrinfo));
-// FIXME in PlibC
-#ifndef MINGW
   hints.ai_family = af;
-#else
-  hints.ai_family = AF_INET;
-#endif
   hints.ai_socktype = SOCK_STREAM;      /* go for TCP */
 
   if (0 != (s = getaddrinfo (hostname, NULL, &hints, &result)))
@@ -291,10 +286,9 @@
                  AF_INET) ? "IPv4" : ((af == AF_INET6) ? "IPv6" : "any"),
                 gai_strerror (s));
     if ((s == EAI_BADFLAGS) || (s == EAI_MEMORY)
-#ifndef MINGW
+#ifndef WINDOWS
         || (s == EAI_SYSTEM)
 #else
-        // FIXME NILS
         || 1
 #endif
         )
@@ -303,8 +297,7 @@
   }
   if (result == NULL)
     return GNUNET_SYSERR;
-  pos = result;
-  while (pos != NULL)
+  for (pos = result; pos != NULL; pos = pos->ai_next)
   {
     switch (pos->ai_family)
     {
@@ -324,7 +317,6 @@
       /* unsupported, skip */
       break;
     }
-    pos = pos->ai_next;
   }
   freeaddrinfo (result);
   return GNUNET_OK;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]