From daf96c774367160500709dafbd9f2cd6cca789a2 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Sun, 25 Oct 2015 12:36:38 +0100 Subject: [PATCH] cleanup so you can now pick if you want 'track' or 'diff' --- pdns/ixplore.cc | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/pdns/ixplore.cc b/pdns/ixplore.cc index 4d09f3aa16..69cde527df 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()<