[ldns-users] ldns_zone_sort does not always retains same order

Ondřej Surý ondrej at sury.org
Tue Oct 16 13:52:16 UTC 2007


I am trying to write zone comparator which will count additions,
deletions and changes between two zone file.

I am sorting both zones and then uses simple iterator to walk in all
domain records.

I have found that there is implementation error in ldns_zone_sort.  It
doesn't retain same order in two different files:

$ ldns-read-zone -z cz.1192527904 > cza
$ ldns-read-zone -z cz.1192531505 > czb
$ diff -w -U 3 cza czb
--- cza 2007-10-16 15:39:38.392629273 +0200
+++ czb 2007-10-16 15:40:10.392819897 +0200
@@ -14885,14 +14885,14 @@
 adao.cz.       18000   IN      NS      ns.forpsi.net.
 adap.cz.       18000   IN      NS      ns.adap.cz.
 adap.cz.       18000   IN      NS      ns2.vshosting.cz.
-adapo.cz.      18000   IN      NS      ns.forpsi.us.
-adapo.cz.      18000   IN      NS      ns.forpsi.net.
 ns.adap.cz.    18000   IN      A
 adap-plus.cz.  18000   IN      NS      ns.banan.cz.
 adap-plus.cz.  18000   IN      NS      ns2.banan.cz.
 adap-plus.cz.  18000   IN      NS      ns3.banan.it.
 adapo.cz.      18000   IN      NS      ns.forpsi.cn.
 adapo.cz.      18000   IN      NS      ns.forpsi.cz.
+adapo.cz.      18000   IN      NS      ns.forpsi.us.
+adapo.cz.      18000   IN      NS      ns.forpsi.net.
 adapobrno.cz.  18000   IN      NS      ns.dns4.cz.
 adapobrno.cz.  18000   IN      NS      ns.dns4.net.
 adapocz.cz.    18000   IN      NS      ns.dns4.cz.
[...and more...]

I'll try to find where the error is... and report back.

Ondřej Surý <ondrej at sury.org>  ***  http://blog.rfc1925.org/
Kulturní občasník              ***  http://www.obcasnik.cz/
Nehoupat, prosím               ***  http://nehoupat.blogspot.com/

More information about the ldns-users mailing list