You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.7 KiB
67 lines
1.7 KiB
--- dnstracer.c 2003-02-14 11:04:03.000000000 +0100 |
|
+++ dnstracer.c 2003-07-28 20:40:03.000000000 +0200 |
|
@@ -603,7 +603,11 @@ |
|
get_resource(rr->type,session,rr->data,0)); |
|
} |
|
|
|
+#ifdef NOIPV6 |
|
+void dump_data(struct sockaddr_in *dest4,void *dest6,struct dnssession *session) { |
|
+#else |
|
void dump_data(struct sockaddr_in *dest4,struct sockaddr_in6 *dest6,struct dnssession *session) { |
|
+#endif |
|
struct dnsrr *answerrr; |
|
struct dnsrr *authorityrr; |
|
struct dnsrr *additionalrr; |
|
@@ -719,6 +723,7 @@ |
|
exit(1); |
|
} |
|
|
|
+#if defined(AI_NUMERICHOST) && defined(EAI_NODATA) |
|
if (global_source_address!=NULL) { |
|
struct addrinfo hints,*src_res; |
|
int error; |
|
@@ -745,6 +750,7 @@ |
|
exit(1); |
|
} |
|
} |
|
+#endif |
|
|
|
return s; |
|
} |
|
@@ -1084,7 +1090,11 @@ |
|
// don't have to worry about packets received from previous sessions. |
|
// |
|
session=(struct dnssession *)calloc(1,sizeof(struct dnssession)); |
|
+#ifdef NOIPV6 |
|
+ session->socket=create_socket(AF_INET); |
|
+#else |
|
session->socket=create_socket(ipv6?AF_INET6:AF_INET); |
|
+#endif |
|
session->ipv6=ipv6; |
|
session->server=strdup(server_ip); |
|
session->host=strdup(host); |
|
@@ -1246,7 +1256,11 @@ |
|
struct hostent *h; |
|
char **addr_list=NULL; |
|
|
|
+#ifndef NOIPV6 |
|
h=gethostbyname2(nextserver_name,ip==0?AF_INET:AF_INET6); |
|
+#else |
|
+ h=gethostbyname(nextserver_name); |
|
+#endif |
|
if (h==NULL) continue; |
|
|
|
// |
|
@@ -1480,8 +1494,12 @@ |
|
|
|
{ |
|
struct hostent *h; |
|
+#ifndef NOIPV6 |
|
if (((h=gethostbyname2(server_name,AF_INET6))==NULL) && |
|
((h=gethostbyname2(server_name,AF_INET))==NULL)) { |
|
+#else |
|
+ if ((h=gethostbyname(server_name))==NULL) { |
|
+#endif |
|
fprintf(stderr,"Cannot find IP address for %s\n",server_name); |
|
return 1; |
|
}
|
|
|