| evdns, libevent 2.x | yes | no | yes | no | does not check /etc/hosts updates |
| getaddrinfo_a, glibc 2.9+ | yes | yes (3) | yes | no | N/A on non-linux |
| getaddrinfo, libc | no | yes (3) | yes | no | N/A on Windows, requires pthreads |
-| evdns, libevent 1.x | yes | no | no | no | buggy |
1. EDNS0 is required to have more than 8 addresses behind one hostname.
2. SOA lookup is needed to re-check hostnames on zone serial change
# make sure all vars are set
use_cares=auto
use_udns=no
-use_evdns=no
+use_evdns=yes
dnl Find c-ares
AC_MSG_CHECKING([whether to use c-ares for DNS lookups])
else # !udns
-dnl On libevent 2.x use evdns by default
-if test "$ac_cv_func_evdns_base_new" = "yes"; then
- use_evdns=yes
-fi
-
dnl Allow user to override the decision
AC_ARG_ENABLE(evdns, AC_HELP_STRING([--enable-evdns],[Use libevent for DNS lookups (default on libevent 2.x)]),
[use_evdns=$enableval])
#endif
#ifdef USE_EVDNS
-#ifdef EV_ET
-#define USE_LIBEVENT2
#include <event2/dns.h>
#define addrinfo evutil_addrinfo
#define freeaddrinfo evutil_freeaddrinfo
-#else /* !EV_ET */
-#define USE_LIBEVENT1
-#include <evdns.h>
-#endif /* !EV_ET */
#endif /* USE_EVDNS */
#ifdef USE_CARES
* Custom addrinfo generation
*/
-#if defined(USE_LIBEVENT1) || defined(USE_UDNS) || defined(USE_CARES)
+#if defined(USE_UDNS) || defined(USE_CARES)
static struct addrinfo *mk_addrinfo(const void *adr, int af)
{
}
}
-#if defined(USE_LIBEVENT1) || defined(USE_UDNS)
+#if defined(USE_UDNS)
static inline struct addrinfo *convert_ipv4_result(const struct in_addr *adrs, int count)
{
return NULL;
}
-#endif /* USE_LIBEVENT1 || USE_UDNS */
+#endif /* USE_UDNS */
#ifdef USE_CARES
* ADNS with libevent2 <event2/dns.h>
*/
-#ifdef USE_LIBEVENT2
+#ifdef USE_EVDNS
const char *adns_get_backend(void)
{
evdns_base_free(dns, 0);
}
-#endif /* USE_LIBEVENT2 */
-
-
-/*
- * ADNS with libevent 1.x <evdns.h>
- */
-
-#ifdef USE_LIBEVENT1
-
-const char *adns_get_backend(void)
-{
- return "evdns1";
-}
-
-static void got_result_evdns(int result, char type, int count, int ttl, void *addresses, void *arg)
-{
- struct DNSRequest *req = arg;
- struct addrinfo *ai;
-
- log_noise("dns: got_result_evdns: type=%d cnt=%d ttl=%d", type, count, ttl);
- if (result == DNS_IPv4_A) {
- ai = convert_ipv4_result(addresses, count);
- if (ai) {
- got_result_gai(0, ai, req);
- return;
- }
- }
- /* lookup failed */
- got_result_gai(1, NULL, req);
-}
-
-static bool impl_init(struct DNSContext *ctx)
-{
- return evdns_init() == 0;
-}
-
-static void impl_launch_query(struct DNSRequest *req)
-{
- int err;
-
- err = evdns_resolve_ipv4(req->name, 0, got_result_evdns, req);
- log_noise("dns(%s): evdns_resolve_ipv4 = %d", req->name, err);
- if (err != 0 && !req->done) {
- /* if callback was not yet called, do it now */
- got_result_gai(1, NULL, req);
- }
-}
-
-static void impl_release(struct DNSContext *ctx)
-{
- evdns_shutdown(0);
-}
-
-#endif /* USE_LIBEVENT1 */
+#endif /* USE_EVDNS */
/*