|
@@ -48,6 +48,7 @@
|
|
#include <arpa/nameser.h>
|
|
#include <arpa/nameser.h>
|
|
#include <resolv.h>
|
|
#include <resolv.h>
|
|
#include "counters.h"
|
|
#include "counters.h"
|
|
|
|
+#include "dns_func.h"
|
|
|
|
|
|
#ifdef __OS_darwin
|
|
#ifdef __OS_darwin
|
|
#include <arpa/nameser_compat.h>
|
|
#include <arpa/nameser_compat.h>
|
|
@@ -58,9 +59,6 @@
|
|
#include "dns_wrappers.h"
|
|
#include "dns_wrappers.h"
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-#ifdef USE_DNSSEC
|
|
|
|
-#include <validator/validator.h>
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
/* define RESOLVE_DBG for debugging info (very noisy) */
|
|
/* define RESOLVE_DBG for debugging info (very noisy) */
|
|
#define RESOLVE_DBG
|
|
#define RESOLVE_DBG
|
|
@@ -90,6 +88,7 @@ struct dns_counters_h {
|
|
};
|
|
};
|
|
|
|
|
|
extern struct dns_counters_h dns_cnts_h;
|
|
extern struct dns_counters_h dns_cnts_h;
|
|
|
|
+extern struct dns_func_t dns_func;
|
|
|
|
|
|
/* query union*/
|
|
/* query union*/
|
|
union dns_query{
|
|
union dns_query{
|
|
@@ -404,9 +403,6 @@ static inline struct hostent* _resolvehost(char* name)
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#ifdef DNS_IP_HACK
|
|
#ifdef DNS_IP_HACK
|
|
-#ifdef USE_DNSSEC
|
|
|
|
- val_status_t val_status;
|
|
|
|
-#endif
|
|
|
|
struct ip_addr* ip;
|
|
struct ip_addr* ip;
|
|
str s;
|
|
str s;
|
|
|
|
|
|
@@ -437,14 +433,7 @@ static inline struct hostent* _resolvehost(char* name)
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
/* ipv4 */
|
|
/* ipv4 */
|
|
-#ifndef USE_DNSSEC
|
|
|
|
- he=gethostbyname(name);
|
|
|
|
-#else
|
|
|
|
- he=val_gethostbyname( (val_context_t *) 0, name, &val_status);
|
|
|
|
- if(!val_istrusted(val_status)){
|
|
|
|
- LOG(L_INFO, "INFO: got not trusted record when resolving %s\n",name);
|
|
|
|
- }
|
|
|
|
-#endif
|
|
|
|
|
|
+ he=dns_func.sr_gethostbyname(name);
|
|
|
|
|
|
#ifdef USE_IPV6
|
|
#ifdef USE_IPV6
|
|
if(he==0 && cfg_get(core, core_cfg, dns_try_ipv6)){
|
|
if(he==0 && cfg_get(core, core_cfg, dns_try_ipv6)){
|
|
@@ -453,14 +442,7 @@ skip_ipv4:
|
|
#endif
|
|
#endif
|
|
/*try ipv6*/
|
|
/*try ipv6*/
|
|
#ifdef HAVE_GETHOSTBYNAME2
|
|
#ifdef HAVE_GETHOSTBYNAME2
|
|
- #ifndef USE_DNSSEC
|
|
|
|
- he=gethostbyname2(name, AF_INET6);
|
|
|
|
- #else
|
|
|
|
- he=val_gethostbyname2((val_context_t*)0, name, AF_INET6, &val_status);
|
|
|
|
- if(!val_istrusted(val_status)){
|
|
|
|
- LOG(L_INFO, "INFO: got not trusted record when resolving %s\n",name);
|
|
|
|
- }
|
|
|
|
- #endif //!USE_DNSSEC
|
|
|
|
|
|
+ he=dns_func.sr_gethostbyname2(name, AF_INET6);
|
|
#elif defined HAVE_GETIPNODEBYNAME
|
|
#elif defined HAVE_GETIPNODEBYNAME
|
|
/* on solaris 8 getipnodebyname has a memory leak,
|
|
/* on solaris 8 getipnodebyname has a memory leak,
|
|
* after some time calls to it will fail with err=3
|
|
* after some time calls to it will fail with err=3
|