[Pdns-users] Generic PostgreSQL backend ignores AAAA (IPv6) addresses

bert hubert ahu at ds9a.nl
Wed Mar 12 14:09:44 UTC 2003


On Wed, Mar 12, 2003 at 02:55:01PM +0100, Stephane Bortzmeyer wrote:

> But, when replying to a NS query, they are not loaded in the
> additional section:

indeed - this was not done so far as it is a performance penalty and rarely
needed. But it was high time this was added. You can turn AAAA additional
processing on with "do-ipv6-additional-processing" in the configuration:

RCS file: /var/cvsroot/pdns/pdns/common_startup.cc,v
retrieving revision 1.12
diff -u -B -b -r1.12 common_startup.cc
--- pdns/common_startup.cc	4 Mar 2003 18:33:39 -0000	1.12
+++ pdns/common_startup.cc	12 Mar 2003 14:06:36 -0000
@@ -91,6 +91,7 @@
   arg().set("webserver-password","Password required for accessing the webserver")="";
 
   arg().setSwitch("out-of-zone-additional-processing","Do out of zone additional processing")="no";
+  arg().setSwitch("do-ipv6-additional-processing", "Do AAAA additional processing")="no";
   arg().setSwitch("query-logging","Hint backends that queries should be logged")="no";
   
   arg().set("cache-ttl","Seconds to store packets in the PacketCache")="20";
@@ -162,7 +163,7 @@
   N->send(AD.A);
   numanswered++;
   int diff=AD.A->d_dt.udiff();
-  avg_latency=(int)(0.999*avg_latency+0.001*diff);
+  avg_latency=(int)(1023*avg_latency/1024+diff/1024);
 
   delete AD.A;  
 
RCS file: /var/cvsroot/pdns/pdns/packethandler.cc,v
retrieving revision 1.10
diff -u -B -b -r1.10 packethandler.cc
--- pdns/packethandler.cc	25 Feb 2003 12:36:49 -0000	1.10
+++ pdns/packethandler.cc	12 Mar 2003 14:06:37 -0000
@@ -50,6 +50,7 @@
   d_doCNAME = (arg()["skip-cname"]=="no");
   d_doRecursion= arg().mustDo("recursor");
   d_logDNSDetails= arg().mustDo("log-dns-details");
+  d_doIPv6AdditionalProcessing = arg().mustDo("do-ipv6-additional-processing");
 }
 
 DNSBackend *PacketHandler::getBackend()
@@ -302,7 +303,6 @@
     DLOG(L<<Logger::Warning<<"This packet needs additional processing!"<<endl);
 
     vector<DNSResourceRecord> arrs=r->getAPRecords();
-    
     for(vector<DNSResourceRecord>::const_iterator i=arrs.begin();
 	i!=arrs.end();
 	++i) {
@@ -306,7 +306,11 @@
     for(vector<DNSResourceRecord>::const_iterator i=arrs.begin();
 	i!=arrs.end();
 	++i) {
+
       B.lookup("A",i->content,p);  
+
+    retryWithIpV6:
+
       bool foundOne=false;
       while(B.get(rr)) {
 	foundOne=true;
@@ -337,6 +341,10 @@
 	    // L<<Logger::Error<<"Trying to do additional processing for answer to '"<<p->qdomain<<"' query: "<<re.reason<<endl;
 	  }
 	}
+      }
+      if(d_doIPv6AdditionalProcessing) {
+	B.lookup("AAAA", i->content, p);
+	goto retryWithIpV6;
       }
     }
   }

===================================================================
RCS file: /var/cvsroot/pdns/pdns/packethandler.hh,v
retrieving revision 1.4
diff -u -B -b -r1.4 packethandler.hh
--- pdns/packethandler.hh	21 Jan 2003 10:42:34 -0000	1.4
+++ pdns/packethandler.hh	12 Mar 2003 14:06:37 -0000
@@ -97,6 +97,7 @@
   bool d_doWildcards;
   bool d_doCNAME;
   bool d_logDNSDetails;
+  bool d_doIPv6AdditionalProcessing;
 
   UeberBackend B; // every thread an own instance
 };


-- 
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://lartc.org           Linux Advanced Routing & Traffic Control HOWTO
http://netherlabs.nl                         Consulting


More information about the Pdns-users mailing list