chiark / gitweb /
resolver: Support IPv6 name resolution
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 2 Sep 2014 08:19:37 +0000 (09:19 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 5 Oct 2014 21:39:06 +0000 (22:39 +0100)
Tell adns (via ADNS_FEATURE_MANYAF) that we want mixed address
families in the results, and handle any IPv6 addresses we find.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
resolver.c
secnet.h

index d104c36..d203a96 100644 (file)
@@ -115,6 +115,11 @@ static void resolver_afterpoll(void *sst, struct pollfd *fds, int nfds)
                    case AF_INET:
                        assert(ra->len == sizeof(ca->ia.sin));
                        break;
+#ifdef CONFIG_IPV6
+                   case AF_INET6:
+                       assert(ra->len == sizeof(ca->ia.sin6));
+                       break;
+#endif /*CONFIG_IPV6*/
                    default:
                        /* silently skip unexpected AFs from adns */
                        continue;
index ead7471..ad4d91c 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -3,6 +3,8 @@
 #ifndef secnet_h
 #define secnet_h
 
+#define ADNS_FEATURE_MANYAF
+
 #include "config.h"
 #include <stdlib.h>
 #include <stdarg.h>