From 64ff52f33933e4e3f4406f32858082fc385b5698 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Fri, 9 Sep 2011 14:55:52 +0000 Subject: [PATCH] Actually pick up inet_pton errors in parsing AAAA content. Correct spurious insertion of space in pipebackend for abiversion 3. Together, these fixes make AAAA records possible in v3 pipe backends. git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2260 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- modules/pipebackend/pipebackend.cc | 2 +- pdns/dnsrecords.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/pipebackend/pipebackend.cc b/modules/pipebackend/pipebackend.cc index 975c10c4f..c72133d7e 100644 --- a/modules/pipebackend/pipebackend.cc +++ b/modules/pipebackend/pipebackend.cc @@ -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]); } diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index be36b98e2..55bfb057c 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -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; } -- 2.50.0