|
|
@@ -1,6 +1,7 @@
|
|
|
---- dnstracer.c 2003-02-14 11:04:03.000000000 +0100
|
|
|
-+++ dnstracer.c 2003-07-28 20:40:03.000000000 +0200
|
|
|
-@@ -603,7 +603,11 @@
|
|
|
+Index: dnstracer.c
|
|
|
+--- dnstracer.c.orig 2004-07-08 13:17:59.000000000 +0200
|
|
|
++++ dnstracer.c 2004-10-08 13:46:54.091634581 +0200
|
|
|
+@@ -642,7 +642,11 @@
|
|
|
get_resource(rr->type,session,rr->data,0));
|
|
|
}
|
|
|
|
|
|
@@ -12,7 +13,7 @@
|
|
|
struct dnsrr *answerrr;
|
|
|
struct dnsrr *authorityrr;
|
|
|
struct dnsrr *additionalrr;
|
|
|
-@@ -719,6 +723,7 @@
|
|
|
+@@ -758,6 +762,7 @@
|
|
|
exit(1);
|
|
|
}
|
|
|
|
|
|
@@ -20,7 +21,7 @@
|
|
|
if (global_source_address!=NULL) {
|
|
|
struct addrinfo hints,*src_res;
|
|
|
int error;
|
|
|
-@@ -745,6 +750,7 @@
|
|
|
+@@ -784,6 +789,7 @@
|
|
|
exit(1);
|
|
|
}
|
|
|
}
|
|
|
@@ -28,7 +29,33 @@
|
|
|
|
|
|
return s;
|
|
|
}
|
|
|
-@@ -1084,7 +1090,11 @@
|
|
|
+@@ -1048,6 +1054,25 @@
|
|
|
+
|
|
|
+ /*****************************************************************************/
|
|
|
+
|
|
|
++static char *my_strcasestr(const char *s, const char *find)
|
|
|
++{
|
|
|
++ char c, sc;
|
|
|
++ size_t len;
|
|
|
++
|
|
|
++ if ((c = *find++) != 0) {
|
|
|
++ c = tolower((unsigned char)c);
|
|
|
++ len = strlen(find);
|
|
|
++ do {
|
|
|
++ do {
|
|
|
++ if ((sc = *s++) == 0)
|
|
|
++ return (NULL);
|
|
|
++ } while ((char)tolower((unsigned char)sc) != c);
|
|
|
++ } while (strncasecmp(s, find, len) != 0);
|
|
|
++ s--;
|
|
|
++ }
|
|
|
++ return ((char *)s);
|
|
|
++}
|
|
|
++
|
|
|
+ //
|
|
|
+ // The core of this program
|
|
|
+ //
|
|
|
+@@ -1123,7 +1148,11 @@
|
|
|
// don't have to worry about packets received from previous sessions.
|
|
|
//
|
|
|
session=(struct dnssession *)calloc(1,sizeof(struct dnssession));
|
|
|
@@ -40,7 +67,16 @@
|
|
|
session->ipv6=ipv6;
|
|
|
session->server=strdup(server_ip);
|
|
|
session->host=strdup(host);
|
|
|
-@@ -1246,7 +1256,11 @@
|
|
|
+@@ -1233,7 +1262,7 @@
|
|
|
+ }
|
|
|
+
|
|
|
+ if (server_authfor!=NULL && strcmp(server_authfor,".")!=0 &&
|
|
|
+- (unsigned char *)strcasestr(rrauth->domainname_string,server_authfor)!=rrauth->domainname_string+strlen(rrauth->domainname_string)-strlen(server_authfor)) {
|
|
|
++ (unsigned char *)my_strcasestr(rrauth->domainname_string,server_authfor)!=rrauth->domainname_string+strlen(rrauth->domainname_string)-strlen(server_authfor)) {
|
|
|
+ if (!refersbackwards++)
|
|
|
+ printf("Refers backwards ");
|
|
|
+ rrauth=rrauth->next;
|
|
|
+@@ -1300,7 +1329,11 @@
|
|
|
struct hostent *h;
|
|
|
char **addr_list=NULL;
|
|
|
|
|
|
@@ -52,7 +88,7 @@
|
|
|
if (h==NULL) continue;
|
|
|
|
|
|
//
|
|
|
-@@ -1480,8 +1494,12 @@
|
|
|
+@@ -1540,8 +1573,12 @@
|
|
|
|
|
|
{
|
|
|
struct hostent *h;
|