]> granicus.if.org Git - pdns/commitdiff
all travis binaries now build, testrunner passes too (and found some real bugs! yay...
authorbert hubert <bert.hubert@netherlabs.nl>
Sun, 27 Sep 2015 20:47:12 +0000 (22:47 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Sun, 27 Sep 2015 20:47:12 +0000 (22:47 +0200)
15 files changed:
pdns/calidns.cc
pdns/dnstcpbench.cc
pdns/notify.cc
pdns/nsec3dig.cc
pdns/packetcache.hh
pdns/saxfr.cc
pdns/sdig.cc
pdns/test-bindparser_cc.cc
pdns/test-distributor_hh.cc
pdns/test-dnsname_cc.cc
pdns/test-dnsrecords_cc.cc
pdns/test-packetcache_cc.cc
pdns/test-zoneparser_tng_cc.cc
pdns/toysdig.cc
pdns/tsig-tests.cc

index 25b10860c9c2a08ccff992c0b278cc296e3a3347..47999d4e58b7d08a80240f20515a745c726d2681 100644 (file)
@@ -146,7 +146,7 @@ try
     vector<uint8_t> packet;
     boost::trim(line);
     auto p = splitField(line, ' ');
-    DNSPacketWriter pw(packet, p.first, DNSRecordContent::TypeToNumber(p.second));
+    DNSPacketWriter pw(packet, DNSName(p.first), DNSRecordContent::TypeToNumber(p.second));
     packets.push_back(packet);
   }
   cout<<"Generated "<<packets.size()<<" queries"<<endl;
index 19fd8e2440fc7a08af20f95cef9d8ad9f2ce1bc3..25b1ee9aa6ac777e0dc51ac006ba217030b47207 100644 (file)
@@ -62,7 +62,7 @@ struct BenchQuery
 {
   BenchQuery(const std::string& qname_, uint16_t qtype_) : qname(qname_), qtype(qtype_), udpUsec(0), tcpUsec(0), answerSecond(0) {}
   BenchQuery(){}
-  std::string qname;
+  DNSName qname;
   uint16_t qtype;
   uint32_t udpUsec, tcpUsec;
   time_t answerSecond;
index 97e8ffc5ccf1c1a8cdda5e8df5707616b8068de1..3aa620c764338c038da59e8d4d7eddee15467f4d 100644 (file)
@@ -53,7 +53,7 @@ try
     throw runtime_error("Failed to connect PowerDNS socket to address "+pdns.toString()+": "+stringerror());
   
   vector<uint8_t> outpacket;
-  DNSPacketWriter pw(outpacket, argv[2], QType::SOA, 1, Opcode::Notify);
+  DNSPacketWriter pw(outpacket, DNSName(argv[2]), QType::SOA, 1, Opcode::Notify);
   pw.getHeader()->id = random();
 
 
index 2f141a0ce657476e91f2be7ba48c719db9f01efa..ae06576197e0c6d0b6ad0d4faf3435f27ac40d08 100644 (file)
@@ -77,7 +77,7 @@ try
   }
 
   vector<uint8_t> packet;
-  string qname=argv[3];
+  DNSName qname(argv[3]);
   DNSPacketWriter pw(packet, qname, DNSRecordContent::TypeToNumber(argv[4]));
 
   if(recurse)
@@ -118,7 +118,7 @@ try
   delete[] creply;
 
   MOADNSParser mdp(reply);
-  cout<<"Reply to question for qname='"<<mdp.d_qname.toString()<<"', qtype="<<DNSRecordContent::NumberToType(mdp.d_qtype)<<endl;
+  cout<<"Reply to question for qname='"<<mdp.d_qname<<"', qtype="<<DNSRecordContent::NumberToType(mdp.d_qtype)<<endl;
   cout<<"Rcode: "<<mdp.d_header.rcode<<", RD: "<<mdp.d_header.rd<<", QR: "<<mdp.d_header.qr;
   cout<<", TC: "<<mdp.d_header.tc<<", AA: "<<mdp.d_header.aa<<", opcode: "<<mdp.d_header.opcode<<endl;
 
@@ -152,7 +152,7 @@ try
 
     if(i->first.d_type == QType::CNAME)
     {
-      namesseen.insert(stripDot(i->first.d_content->getZoneRepresentation()));
+      namesseen.insert(DNSName(i->first.d_content->getZoneRepresentation()));
     }
 
     cout<<i->first.d_place-1<<"\t"<<i->first.d_label.toString()<<"\tIN\t"<<DNSRecordContent::NumberToType(i->first.d_type);
@@ -173,7 +173,7 @@ try
   cout<<"== nsec3 prove/deny report follows =="<<endl;
   set<DNSName> proven;
   set<DNSName> denied;
-  namesseen.insert(stripDot(qname));
+  namesseen.insert(qname);
   for(const auto &n: namesseen)
   {
     DNSName shorter(n);
@@ -184,10 +184,10 @@ try
   for(const auto &n: namestocheck)
   {
     proveOrDeny(nsec3s, n, nsec3salt, nsec3iters, proven, denied);
-    proveOrDeny(nsec3s, "*."+n, nsec3salt, nsec3iters, proven, denied);
+    proveOrDeny(nsec3s, DNSName("*")+n, nsec3salt, nsec3iters, proven, denied);
   }
 
-  if(names.count(qname+"."))
+  if(names.count(qname))
   {
     cout<<"== qname found in names, investigating NSEC3s in case it's a wildcard"<<endl;
     // exit(EXIT_SUCCESS);
index a5dca6350b6d0df0cd5d5fcc59a685378a4b8328..964c8c7e37e776ccfcd2130165e031738984ff16 100644 (file)
@@ -66,7 +66,7 @@ public:
   int size(); //!< number of entries in the cache
   void cleanup(); //!< force the cache to preen itself from expired packets
   int purge();
-  int purge(const string &match);
+  int purge(const std::string& match); // could be $ terminated. Is not a dnsname!
 
   map<char,int> getCounts();
 private:
index c426098db588481aaa46997d4ad01f1039ee888c..a5bd34796967987200162f46db20bb56f5c110e0 100644 (file)
@@ -53,7 +53,7 @@ try
   bool gss=false;
   bool tsig=false;
   TSIGHashEnum tsig_algo;
-  string tsig_key;
+  DNSName tsig_key;
   string tsig_secret;
   string tsigprevious;
   string remote_principal;
@@ -84,12 +84,12 @@ try
           cerr<<"Invalid syntax for tsig"<<endl;
           exit(EXIT_FAILURE);
         }
-        if (!getTSIGHashEnum(parts[2], tsig_algo)) {
+        if (!getTSIGHashEnum(DNSName(parts[2]), tsig_algo)) {
           cerr<<"Cannot understand TSIG algorithm '"<<parts[1]<<"'"<<endl;
           exit(EXIT_FAILURE);
         }
-        tsig_key = parts[1];
-        if (tsig_key.size()==0) {
+        tsig_key = DNSName(parts[1]);
+        if (tsig_key == DNSName()) {
           cerr<<"Key name must be set for tsig"<<endl;
           exit(EXIT_FAILURE);
         }
@@ -179,11 +179,11 @@ try
       exit(EXIT_FAILURE);
     }
 
-    tsig_key = gssctx.getLabel();
+    tsig_key = DNSName(gssctx.getLabel());
 #endif
   }
 
-  DNSPacketWriter pw(packet, argv[3], 252);
+  DNSPacketWriter pw(packet, DNSName(argv[3]), 252);
 
   pw.getHeader()->id = dns_random(0xffff);
 
@@ -295,7 +295,7 @@ try
       DNSName shorter(i->first.d_label);
       do {
         labels.insert(shorter);
-        if (pdns_iequals(shorter, argv[3]))
+        if (shorter == DNSName(argv[3]))
           break;
       }while(shorter.chopOff());
 
@@ -317,7 +317,7 @@ try
     DNSName label /* FIXME400 rename */=record.first;
     if (isNSEC3 && unhash)
     {
-      auto i = hashes.find(label.makeRelative(argv[3]).toStringNoDot());
+      auto i = hashes.find(label.makeRelative(DNSName(argv[3])).toStringNoDot());
       if (i != hashes.end())
         label=i->second;
     }
index f0ed8de4782c0d7c5a6a43b68d08418ab08827e7..41187fecae1cbe9b790fd6530f9eb43a0299873f 100644 (file)
@@ -44,7 +44,7 @@ try
 
   vector<uint8_t> packet;
   
-  DNSPacketWriter pw(packet, argv[3], DNSRecordContent::TypeToNumber(argv[4]));
+  DNSPacketWriter pw(packet, DNSName(argv[3]), DNSRecordContent::TypeToNumber(argv[4]));
 
   if(dnssec || getenv("SDIGBUFSIZE"))
   {
index e0402824aaa61ead853384c14c90a136b847995b..149ce0c91700171959e0ef9b9670c61b006255a3 100644 (file)
@@ -35,7 +35,7 @@ BOOST_AUTO_TEST_CASE(test_parser) {
         BOOST_CHECK_EQUAL(domains.size(), 11);
 
 #define checkzone(i, dname, fname, ztype, nmasters) { \
-                BOOST_CHECK(domains[i].name == #dname); \
+               BOOST_CHECK(domains[i].name == DNSName(#dname));     \
                 BOOST_CHECK_EQUAL(domains[i].filename, fname); \
                 BOOST_CHECK_EQUAL(domains[i].type, #ztype); \
                 BOOST_CHECK_EQUAL(domains[i].masters.size(), nmasters); \
index 0760be026157ecf993f75874225c4994ed3fb086..a1cd677bcde8b338e6bdb169530ddee182df5fb7 100644 (file)
@@ -123,7 +123,7 @@ BOOST_AUTO_TEST_CASE(test_distributor_dies) {
     for(int n=0; n < 100; ++n)  {
       auto q = new Question();
       q->d_dt.set(); 
-      q->qdomain=std::to_string(n);
+      q->qdomain=DNSName(std::to_string(n));
       d->question(q, report2);
     }
 
index 54dd369026772f06ef3a6b2c12f390753682069d..5c78943e45683f710ac0d6220a995ce8f90c75e0 100644 (file)
@@ -212,10 +212,10 @@ BOOST_AUTO_TEST_CASE(test_Append) {
 BOOST_AUTO_TEST_CASE(test_QuestionHash) {
   vector<unsigned char> packet;
   reportBasicTypes();
-  DNSPacketWriter dpw1(packet, "www.ds9a.nl.", QType::AAAA);
+  DNSPacketWriter dpw1(packet, DNSName("www.ds9a.nl."), QType::AAAA);
   
   auto hash1=hashQuestion((char*)&packet[0], packet.size(), 0);
-  DNSPacketWriter dpw2(packet, "wWw.Ds9A.nL.", QType::AAAA);
+  DNSPacketWriter dpw2(packet, DNSName("wWw.Ds9A.nL."), QType::AAAA);
   auto hash2=hashQuestion((char*)&packet[0], packet.size(), 0);
   BOOST_CHECK_EQUAL(hash1, hash2);
  
@@ -223,7 +223,7 @@ BOOST_AUTO_TEST_CASE(test_QuestionHash) {
  
   for(unsigned int n=0; n < 100000; ++n) {
     packet.clear();
-    DNSPacketWriter dpw1(packet, std::to_string(n)+"."+std::to_string(n*2)+".", QType::AAAA);
+    DNSPacketWriter dpw1(packet, DNSName(std::to_string(n)+"."+std::to_string(n*2)+"."), QType::AAAA);
     counts[hashQuestion((char*)&packet[0], packet.size(), 0) % counts.size()]++;
   }
   
@@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(test_QuestionHash) {
 BOOST_AUTO_TEST_CASE(test_packetParse) {
   vector<unsigned char> packet;
   reportBasicTypes();
-  DNSPacketWriter dpw(packet, "www.ds9a.nl.", QType::AAAA);
+  DNSPacketWriter dpw(packet, DNSName("www.ds9a.nl."), QType::AAAA);
   
   uint16_t qtype, qclass;
   DNSName dn((char*)&packet[0], packet.size(), 12, false, &qtype, &qclass);
@@ -251,7 +251,7 @@ BOOST_AUTO_TEST_CASE(test_packetParse) {
   BOOST_CHECK(qtype == QType::AAAA);
   BOOST_CHECK_EQUAL(qclass, 1);
 
-  dpw.startRecord("ds9a.nl.", DNSRecordContent::TypeToNumber("NS"));
+  dpw.startRecord(DNSName("ds9a.nl."), DNSRecordContent::TypeToNumber("NS"));
   NSRecordContent nrc("ns1.powerdns.com");
   nrc.toPacket(dpw);
 
@@ -344,20 +344,25 @@ BOOST_AUTO_TEST_CASE(test_compare_canonical) {
   BOOST_CHECK(lower.canonCompare(higher));
 
 
-  vector<DNSName> vec({"bert.com.", "alpha.nl.", "articles.xxx.",
+  vector<DNSName> vec;
+  for(const std::string& a : {"bert.com.", "alpha.nl.", "articles.xxx.",
        "Aleph1.powerdns.com.", "ZOMG.powerdns.com.", "aaa.XXX.", "yyy.XXX.", 
-       "test.powerdns.com."});
+       "test.powerdns.com."}) {
+    vec.push_back(DNSName(a));
+  }
   sort(vec.begin(), vec.end(), CanonDNSNameCompare());
   //  for(const auto& v : vec)
   //  cerr<<'"'<<v.toString()<<'"'<<endl;
 
-  vector<DNSName> right({"bert.com.",  "Aleph1.powerdns.com.",
+  vector<DNSName> right;
+  for(const auto& a: {"bert.com.",  "Aleph1.powerdns.com.",
        "test.powerdns.com.",
        "ZOMG.powerdns.com.",
        "alpha.nl.",
        "aaa.XXX.",
        "articles.xxx.",
-       "yyy.XXX."});
+       "yyy.XXX."})
+    right.push_back(DNSName(a));
 
   BOOST_CHECK(vec==right);
 }
index db6dc4744112bc3b126d4f926b4f49c0751b7eab..697dd249579789a0edbf15b0537be5dcd1c6b39a 100644 (file)
@@ -197,13 +197,13 @@ BOOST_AUTO_TEST_CASE(test_record_types) {
         default:
            REC_CHECK_EQUAL(rec->getZoneRepresentation(), val.get<2>());
         }
-        recData = rec->serialize("rec.test");
+        recData = rec->serialize(DNSName("rec.test"));
       } else {
-        std::shared_ptr<DNSRecordContent> rec3 = DNSRecordContent::unserialize("rec.test",q.getCode(),(val.get<3>()));
+        std::shared_ptr<DNSRecordContent> rec3 = DNSRecordContent::unserialize(DNSName("rec.test"),q.getCode(),(val.get<3>()));
         // TSIG special, only works the other way
-        recData = rec3->serialize("rec.test");
+        recData = rec3->serialize(DNSName("rec.test"));
       }
-      std::shared_ptr<DNSRecordContent> rec2 = DNSRecordContent::unserialize("rec.test",q.getCode(),recData);
+      std::shared_ptr<DNSRecordContent> rec2 = DNSRecordContent::unserialize(DNSName("rec.test"),q.getCode(),recData);
       BOOST_CHECK_MESSAGE(rec2 != NULL, "unserialize(rec.test, " << q.getCode() << ", recData) returned NULL");
       if (rec2 == NULL) continue;
       // now verify the zone representation (here it can be different!)
@@ -260,14 +260,14 @@ BOOST_AUTO_TEST_CASE(test_record_types_bad_values) {
     BOOST_TEST_MESSAGE("Checking bad value for record type " << q.getName() << " test #" << n);
  
     vector<uint8_t> packet;
-    DNSPacketWriter pw(packet, "unit.test", q.getCode());
+    DNSPacketWriter pw(packet, DNSName("unit.test"), q.getCode());
 
     if (val.get<2>()) {
       bool success=true;
-      BOOST_WARN_EXCEPTION( { boost::scoped_ptr<DNSRecordContent> drc(DNSRecordContent::mastermake(q.getCode(), 1, val.get<1>())); pw.startRecord("unit.test", q.getCode()); drc->toPacket(pw); success=false; }, std::runtime_error, test_dnsrecords_cc_predicate );
+      BOOST_WARN_EXCEPTION( { boost::scoped_ptr<DNSRecordContent> drc(DNSRecordContent::mastermake(q.getCode(), 1, val.get<1>())); pw.startRecord(DNSName("unit.test"), q.getCode()); drc->toPacket(pw); success=false; }, std::runtime_error, test_dnsrecords_cc_predicate );
       if (success==false) REC_FAIL_XSUCCESS2(q.getName() << " test #" << n << " has unexpectedly passed"); // a bad record was detected when it was supposed not to be detected
     } else {
-      BOOST_CHECK_EXCEPTION( { boost::scoped_ptr<DNSRecordContent> drc(DNSRecordContent::mastermake(q.getCode(), 1, val.get<1>())); pw.startRecord("unit.test", q.getCode()); drc->toPacket(pw); }, std::runtime_error, test_dnsrecords_cc_predicate );
+      BOOST_CHECK_EXCEPTION( { boost::scoped_ptr<DNSRecordContent> drc(DNSRecordContent::mastermake(q.getCode(), 1, val.get<1>())); pw.startRecord(DNSName("unit.test"), q.getCode()); drc->toPacket(pw); }, std::runtime_error, test_dnsrecords_cc_predicate );
     }
   };
 }
@@ -296,8 +296,8 @@ BOOST_AUTO_TEST_CASE(test_opt_record_out) {
   vector<uint8_t> pak;
   vector<pair<uint16_t,string > > opts;
 
-  DNSPacketWriter pw(pak, "www.powerdns.com", QType::A);
-  pw.startRecord("www.powerdns.com", QType::A, 16, 1, DNSPacketWriter::ANSWER);
+  DNSPacketWriter pw(pak, DNSName("www.powerdns.com"), QType::A);
+  pw.startRecord(DNSName("www.powerdns.com"), QType::A, 16, 1, DNSPacketWriter::ANSWER);
   pw.xfrIP(htonl(0x7f000001));
   opts.push_back(pair<uint16_t,string>(3, "powerdns"));
   pw.addOpt(1280, 0, 0, opts);
index 19052c1de58f4351a438a03f8f9c886c77a833a9..5ff82ef1c2fd11178e7e63fd403dc859c6249503 100644 (file)
@@ -31,7 +31,7 @@ BOOST_AUTO_TEST_CASE(test_PacketCacheSimple) {
 
 
   BOOST_CHECK_EQUAL(PC.size(), 0);
-  PC.insert("hello", QType(QType::A), PacketCache::QUERYCACHE, "something", 3600, 1);
+  PC.insert(DNSName("hello"), QType(QType::A), PacketCache::QUERYCACHE, "something", 3600, 1);
   BOOST_CHECK_EQUAL(PC.size(), 1);
   PC.purge();
   BOOST_CHECK_EQUAL(PC.size(), 0);
@@ -39,14 +39,14 @@ BOOST_AUTO_TEST_CASE(test_PacketCacheSimple) {
   int counter=0;
   try {
     for(counter = 0; counter < 100000; ++counter) {
-      PC.insert("hello "+boost::lexical_cast<string>(counter), QType(QType::A), PacketCache::QUERYCACHE, "something", 3600, 1);
+      PC.insert(DNSName("hello ")+DNSName(boost::lexical_cast<string>(counter)), QType(QType::A), PacketCache::QUERYCACHE, "something", 3600, 1);
     }
 
     BOOST_CHECK_EQUAL(PC.size(), counter);
     
     int delcounter=0;
     for(delcounter=0; delcounter < counter/100; ++delcounter) {
-      PC.purge("hello "+boost::lexical_cast<string>(delcounter));
+      PC.purge((DNSName("hello ")+DNSName(boost::lexical_cast<string>(delcounter))).toString());
     }
     
     BOOST_CHECK_EQUAL(PC.size(), counter-delcounter);
@@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(test_PacketCacheSimple) {
     string entry;
     int expected=counter-delcounter;
     for(; delcounter < counter; ++delcounter) {
-      if(PC.getEntry("hello "+boost::lexical_cast<string>(delcounter), QType(QType::A), PacketCache::QUERYCACHE, entry, 1)) {
+      if(PC.getEntry(DNSName("hello ")+DNSName(boost::lexical_cast<string>(delcounter)), QType(QType::A), PacketCache::QUERYCACHE, entry, 1)) {
        matches++;
       }
     }
@@ -76,7 +76,7 @@ try
 {
   unsigned int offset=(unsigned int)(unsigned long)a;
   for(unsigned int counter=0; counter < 100000; ++counter)
-    g_PC->insert("hello "+boost::lexical_cast<string>(counter+offset), QType(QType::A), PacketCache::QUERYCACHE, "something", 3600, 1);    
+    g_PC->insert(DNSName("hello ")+DNSName(boost::lexical_cast<string>(counter+offset)), QType(QType::A), PacketCache::QUERYCACHE, "something", 3600, 1);    
   return 0;
 }
  catch(PDNSException& e) {
@@ -92,7 +92,7 @@ try
   unsigned int offset=(unsigned int)(unsigned long)a;
   string entry;
   for(unsigned int counter=0; counter < 100000; ++counter)
-    if(!g_PC->getEntry("hello "+boost::lexical_cast<string>(counter+offset), QType(QType::A), PacketCache::QUERYCACHE, entry, 1)) {
+    if(!g_PC->getEntry(DNSName("hello ")+DNSName(boost::lexical_cast<string>(counter+offset)), QType(QType::A), PacketCache::QUERYCACHE, entry, 1)) {
        g_missing++;
     }
   return 0;
@@ -153,7 +153,7 @@ BOOST_AUTO_TEST_CASE(test_PacketCacheClean) {
     PacketCache PC;
 
     for(unsigned int counter = 0; counter < 1000000; ++counter) {
-      PC.insert("hello "+boost::lexical_cast<string>(counter), QType(QType::A), PacketCache::QUERYCACHE, "something", 1, 1);
+      PC.insert(DNSName("hello ")+DNSName(boost::lexical_cast<string>(counter)), QType(QType::A), PacketCache::QUERYCACHE, "something", 1, 1);
     }
 
     sleep(1);
@@ -189,13 +189,13 @@ BOOST_AUTO_TEST_CASE(test_PacketCachePacket) {
     vector<uint8_t> pak;
     vector<pair<uint16_t,string > > opts;
 
-    DNSPacketWriter pw(pak, "www.powerdns.com", QType::A);
+    DNSPacketWriter pw(pak, DNSName("www.powerdns.com"), QType::A);
     DNSPacket q, r, r2;
     q.parse((char*)&pak[0], pak.size());
 
     pak.clear();
-    DNSPacketWriter pw2(pak, "www.powerdns.com", QType::A);
-    pw2.startRecord("www.powerdns.com", QType::A, 16, 1, DNSPacketWriter::ANSWER);
+    DNSPacketWriter pw2(pak, DNSName("www.powerdns.com"), QType::A);
+    pw2.startRecord(DNSName("www.powerdns.com"), QType::A, 16, 1, DNSPacketWriter::ANSWER);
     pw2.xfrIP(htonl(0x7f000001));
     pw2.commit();
 
index c8ff12da8fe9cffcab97d10ca68e411af526ffc2..e9955e615a1fb8f52b8fdf34e3ef1042276da0d2 100644 (file)
@@ -27,7 +27,7 @@ BOOST_AUTO_TEST_CASE(test_tng_record_types) {
   if(!p)
     p = ".";
   pathbuf << p << "/../regression-tests/zones/unit.test";
-  ZoneParserTNG zp(pathbuf.str(), "unit.test");
+  ZoneParserTNG zp(pathbuf.str(), DNSName("unit.test"));
   DNSResourceRecord rr;
 
   ifstream ifs(pathbuf.str());
index da63fa2f8816238a2f2ceb0117ea5159680c5501..5db9b703673cf04eab75d44387c501fde14b6ebd 100644 (file)
@@ -32,7 +32,7 @@ try
     else
       qname=boost::lexical_cast<string>(n)+"."+argv[3];
     
-    DNSPacketWriter pw(packet, qname, DNSRecordContent::TypeToNumber(argv[4]));
+    DNSPacketWriter pw(packet, DNSName(qname), DNSRecordContent::TypeToNumber(argv[4]));
 
     pw.getHeader()->rd=1;
 
index 26d2818ca4e69d4e27a6b2fdad587ddb89ca49f9..8739bb915dd588e3a1174f796d27b16ee1ef8396 100644 (file)
@@ -39,7 +39,7 @@ try
 
   vector<uint8_t> packet;
   
-  DNSPacketWriter pw(packet, argv[3], DNSRecordContent::TypeToNumber(argv[4]));
+  DNSPacketWriter pw(packet, DNSName(argv[3]), DNSRecordContent::TypeToNumber(argv[4]));
 
   pw.getHeader()->id=htons(0x4831);
   
@@ -49,7 +49,7 @@ try
   DNSName keyname("pdns-b-aa");
 
   TSIGRecordContent trc;
-  trc.d_algoName="hmac-md5.sig-alg.reg.int";
+  trc.d_algoName=DNSName("hmac-md5.sig-alg.reg.int");
   trc.d_time=time(0);
   trc.d_fudge=300;
   trc.d_origID=ntohs(pw.getHeader()->id);