[Pdns-dev] Parse error IP logging bug (patch included)

mark at nedworks.org mark at nedworks.org
Wed Mar 5 01:02:30 CET 2003


While investigating an issue with AXFRs from a Solaris pdns client,
we discovered that pdns would log totally bogus IPs on the server:

pdns[25322]: Ignoring packet: too short from 7c6e:7330:2e6e:6564:776f:726b:732e:6f72

It appeared that the 'remote' field in the dnspacket class was not being
initialized until *after* the parsing of the dnspacket in method
parse(), which logs the log line above.

Fix included.

-- 
Mark

<mark at nedworks.org>
-------------- next part --------------
--- pdns-2.9.6/pdns/tcpreceiver.cc	Wed Feb  5 14:44:23 2003
+++ pdns-2.9.6-mark2/pdns/tcpreceiver.cc	Wed Mar  5 00:34:45 2003
@@ -157,11 +157,11 @@
       S.inc("tcp-queries");      
       DNSPacket *packet=new DNSPacket;
 
-      if(packet->parse(mesg, pktlen)<0)
-	break;
-
       packet->setRemote((struct sockaddr *)&remote,sizeof(remote));
 
+      if(packet->parse(mesg, pktlen)<0)
+	break;
+      
       if(packet->qtype.getCode()==QType::AXFR) {
 	if(doAXFR(packet->qdomain, packet, fd)) 
 	  S.inc("tcp-answers");  


More information about the Pdns-dev mailing list