]> granicus.if.org Git - pdns/commitdiff
Actually pick up inet_pton errors in parsing AAAA content. Correct spurious insertion...
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Fri, 9 Sep 2011 14:55:52 +0000 (14:55 +0000)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Fri, 9 Sep 2011 14:55:52 +0000 (14:55 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2260 d19b8d6e-7fed-0310-83ef-9ca221ded41b

modules/pipebackend/pipebackend.cc
pdns/dnsrecords.cc

index 975c10c4fff9ea14a11d41b1e7540012a55d44d5..c72133d7e5ae6ca1afe504fb37b20f6fa491ee5b 100644 (file)
@@ -238,7 +238,7 @@ bool PipeBackend::get(DNSResourceRecord &r)
          if(r.qtype.getCode() != QType::MX && r.qtype.getCode() != QType::SRV) {
            r.content.clear();
            for(unsigned int n= 6 + extraFields; n < parts.size(); ++n) {
-             if(n!=6)
+             if(n!=6+extraFields)
                r.content.append(1,' ');
              r.content.append(parts[n]);
            }
index be36b98e201ba9edbc52fc5fafc3fd3e395ac6b9..55bfb057c3e67d581a71b7e9500fb26d585188eb 100644 (file)
@@ -62,7 +62,7 @@ public:
   static DNSRecordContent* make(const string& zone) 
   {
     AAAARecordContent *ar=new AAAARecordContent();
-    if(Utility::inet_pton( AF_INET6, zone.c_str(), static_cast< void * >( ar->d_ip6 )) < 0)
+    if(Utility::inet_pton( AF_INET6, zone.c_str(), static_cast< void * >( ar->d_ip6 )) <= 0)
       throw MOADNSException("Asked to encode '"+zone+"' as an IPv6 address, but does not parse");
     return ar;
   }