[ldns-users] pyLDNS fixes in ldns_rr, ldns_rr_list, ldns_rr_descriptor

Karel Slany karel.slany at nic.cz
Thu Aug 30 14:44:17 UTC 2012


Hello Willem and others,

I've put together another set of patches for pyLDNS. This time it fixes
issues with ldns_rr, ldns_rr_list and related stuff. It also adds a few
new python wrapper methods and improves the documentation.

Here is a list of the fixes, changes and enhancements. A little bit
longer version of it can be found in the modified pyLDNS changelog file.

* Updated documentation of ldsn_rr.
* Created ldns_rr testing script.
* Fixed ldns_rr.a_address(), which was asserting when called
  on non A or AAAA type rr. Now returns None when fails.
  A similar issue on various methods was present and fixed multiple
  times.
* Added deprecation warnings into ldns_rr.new_frm_fp() and
  ldns_rr.new_frm_fp_l() and others.
* Modified ldns_rr.owner(), now returns ldns_dname.
* Fixed ldns_rr.set_rdf(), which may cause memory leaks, because it
  returns new objects (in the scope of Python). Also it leaked memory,
  when the call was not successful.
* Added ldns_rr.set_question(),
* Added ldns_rr_descriptor.ldns_rr_descriptor(), ...
* Fixed ldns_get_rr_list_hosts_frm_file, marked as newobject.
* Added ldns_rr_list.new().
* Fixed ldns_rr_list.cat() to return bool as mentioned in documentation.
* Fixed ldns_rr_list_cat_clone, marked as newobject.
* Fixed ldns_rr_list.new_frm_file(). Exception argument was invalid.
* Modified ldns_rr_list.owner(), now returns ldns_dname.
* Fixed ldns_rr_list.push_rr() to return bool as mentioned in
  documentation.
* Fixed ldns_rr_list.push_rr_list() to return bool as mentioned in
  documentation.
* Fixed ldns_rr_list.set_rr(), which caused memory corruption, double
  free problems and memory leaks. (The wrapper used original function
  instead of its push cloned variant which was missing.)
* Fixed ldns_rr_list.set_rr_count(), added python exception raise in
  order to avoid assertion failure.
* Fixed ldns_rr_list.subtype_by_rdf(), memory leaks, marked newobject.
* Added ldns_rr.to_canonical()
* Added ldns_rr.is_question()
* Added ldns_rr.type_by_name()
* Added ldns_rr.class_by_name()

And possible some small fixes which are not worth mentioning.

The patch introduces a new testing script, so please run

svn add trunk/contrib/python/examples/test_rr.py
chmod +x trunk/contrib/python/examples/test_rr.py

after applying the patch.

Best regards,
K.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldns_rr_rr_list_rr_descriptor.diff.gz
Type: application/gzip
Size: 22886 bytes
Desc: not available
URL: <http://lists.nlnetlabs.nl/pipermail/ldns-users/attachments/20120830/a4a7da14/attachment.bin>


More information about the ldns-users mailing list