[Pdns-dev] bindbackend: parsing of SRV records

Christof Meerwald cmeerw at web.de
Sun Aug 24 17:14:32 CEST 2003


Hi,

there is a bug in the parsing of SRV records in the bindbackend. See RFC
2782 for the format of SRV records:

  "Here is the format of the SRV RR, whose DNS type code is 33:

  _Service._Proto.Name TTL Class SRV Priority Weight Port Target"

But pdns's current parser leaves out the priority field and assumes a SRV
record looks something like:

  _Service._Proto.Name TTL Class SRV Weight Port Target


Here is a small fix:

--- pdns-2.9.10.orig/pdns/backends/bind/zoneparser2.cc
+++ pdns-2.9.10/pdns/backends/bind/zoneparser2.cc
@@ -529,9 +529,13 @@
   int left=words.size()-cpos;
   string content;
 
-  if(qtype=="MX" && left==2) {
-    int prio=atoi(words[cpos++].c_str());
-    content=words[cpos];
+  if((qtype=="MX" && left==2) || (qtype=="SRV" && left==4)){
+    int prio=atoi(words[cpos++].c_str());left--;
+    content=words[cpos++];left--;
+    
+    while(left--)
+      content+=" "+words[cpos++];
+    
     if(content=="@")
       content=d_origin;
     else


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw at jabber.at
mailto cmeerw at web.de


More information about the Pdns-dev mailing list