[Pdns-users] Duplicated MX records

bert hubert ahu at ds9a.nl
Sun Mar 7 11:37:13 UTC 2004


On Sun, Mar 07, 2004 at 12:18:27AM +0100, Roderick Groesbeek wrote:

> DNSPacket::addRecord did not honour the priority and so skipped the adding
> of the record.

Almost right - it should only check the priority for MX records though. This
is my patch, can you check it?

Index: dnspacket.cc
===================================================================
RCS file: /var/cvsroot/pdns/pdns/dnspacket.cc,v
retrieving revision 1.25
diff -u -B -b -r1.25 dnspacket.cc
--- dnspacket.cc	29 Feb 2004 12:57:11 -0000	1.25
+++ dnspacket.cc	7 Mar 2004 11:36:04 -0000
@@ -231,6 +231,7 @@
   if(d_compress)
     for(vector<DNSResourceRecord>::const_iterator i=rrs.begin();i!=rrs.end();++i) 
       if(rr.qname==i->qname && rr.qtype==i->qtype && rr.content==i->content)
+	if(rr.qtype.getCode()!=QType::MX || rr.priority==i->priority)
 	return;
 
   rrs.push_back(rr);


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


More information about the Pdns-users mailing list