From: bert hubert Date: Sun, 25 Oct 2015 11:36:38 +0000 (+0100) Subject: cleanup so you can now pick if you want 'track' or 'diff' X-Git-Tag: dnsdist-1.0.0-alpha1~252^2~6^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=daf96c774367160500709dafbd9f2cd6cca789a2;p=pdns cleanup so you can now pick if you want 'track' or 'diff' --- diff --git a/pdns/ixplore.cc b/pdns/ixplore.cc index 4d09f3aa1..69cde527d 100644 --- a/pdns/ixplore.cc +++ b/pdns/ixplore.cc @@ -82,11 +82,11 @@ vector, vector > > getIXFRDeltas(const Combo DNSPacketWriter pw(packet, zone, QType::IXFR); pw.getHeader()->qr=0; pw.getHeader()->rd=0; + pw.getHeader()->id=dns_random(0xffff); pw.startRecord(zone, QType::SOA, 3600, QClass::IN, DNSPacketWriter::AUTHORITY); sr.d_content->toPacket(pw); pw.commit(); - uint16_t len=htons(packet.size()); string msg((const char*)&len, 2); msg.append((const char*)&packet[0], packet.size()); @@ -135,26 +135,20 @@ vector, vector > > getIXFRDeltas(const Combo if(sr->d_st.serial == masterSOA->d_st.serial) break; - // cout<<"Got delta going from "<d_st.serial< remove, add; remove.push_back(records[pos]); // this adds the SOA for(pos++; pos < records.size() && records[pos].d_type != QType::SOA; ++pos) { - // cout<<"Should remove "<getZoneRepresentation()<(records[pos].d_content); - // cout<<"This delta goes to "<d_st.serial<getZoneRepresentation()<getZoneRepresentation().c_str()); } @@ -243,8 +239,14 @@ int main(int argc, char** argv) try { reportAllTypes(); - if(argc==5 && string(argv[1])=="diff") { + string command; + if(argc < 5 || (command=argv[1], (command!="diff" && command !="track"))) { cerr<<"Syntax: ixplore diff zone file1 file2"<getZoneRepresentation()<