source:
npl/internetserver/djbdns/ignoreip-1.05.patch
Last change on this file was c5c522c, checked in by , 8 years ago | |
---|---|
|
|
File size: 2.3 KB |
-
dnscache.c
This patch changes djbdns's dnscache program so that it will ignore the IP address given in the IGNOREIP environment variable. I wrote this patch because of Verisign's oh-so helpful wildcard A records for *.COM and *.NET. Install the patch like this: patch <djbdns-1.05-ignoreip.patch svc -d /service/dnscache make setup check svc -u /service/dnscache Configure it to ignore Verisign's wildcard record like this: echo 64.94.110.11 >/service/dnscache/env/IGNOREIP svc -t /service/dnscache If IGNOREIP isn't found in the environment variable space, nothing is ignored. -- --My blog is at angry-economist.russnelson.com | Free markets express in the Crynwr sells support for free software | PGPok | practical world our belief 521 Pleasant Valley Rd. | +1 315 268 1925 voice | that there is that of God Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | in all people. -Chris V. diff -u orig/dnscache.c ./dnscache.c
old new 23 23 #include "okclient.h" 24 24 #include "droproot.h" 25 25 26 char ignoreip[4]; 27 26 28 static int packetquery(char *buf,unsigned int len,char **q,char qtype[2],char qclass[2],char id[2]) 27 29 { 28 30 unsigned int pos; … … 431 433 if (!cache_init(cachesize)) 432 434 strerr_die3x(111,FATAL,"not enough memory for cache of size ",x); 433 435 436 x = env_get("IGNOREIP"); 437 if (x) 438 if (!ip4_scan(x,ignoreip)) 439 strerr_die3x(111,FATAL,"unable to parse IGNOREIP address ",x); 440 434 441 if (env_get("HIDETTL")) 435 442 response_hidettl(); 436 443 if (env_get("FORWARDONLY")) -
query.c
diff -u orig/query.c ./query.c
old new 13 13 #include "response.h" 14 14 #include "query.h" 15 15 16 extern char ignoreip[]; 17 16 18 static int flagforwardonly = 0; 17 19 18 20 void query_forwardonly(void) … … 643 645 pos = dns_packet_copy(buf,len,pos,header,10); if (!pos) goto DIE; 644 646 if (byte_equal(header + 8,2,"\0\4")) { 645 647 pos = dns_packet_copy(buf,len,pos,header,4); if (!pos) goto DIE; 648 /* if (*ignoreip) if (byte_equal(header,4,ignoreip)) goto NXDOMAIN;*/ 649 if (*ignoreip) if (byte_equal(header,4,ignoreip)) goto NXDOMAIN; 646 650 save_data(header,4); 647 651 log_rr(whichserver,t1,DNS_T_A,header,4,ttl); 648 652 }
Note: See TracBrowser
for help on using the repository browser.