From vmagerya at gmail.com Sun Aug 5 18:32:24 2012 From: vmagerya at gmail.com (Vitaly Magerya) Date: Sun, 5 Aug 2012 21:32:24 +0300 Subject: [ldns-users] Various fixes Message-ID: Hi, folks. I've been writing a bind9-host replacement using ldns, and there's a number of problems with the library I've run into: 1. ldns_resolver_nameservers_randomize (resolver.c) shuffles _nameservers array, but does not shuffle _rtt array; I think both arrays should be kept in sync. 2. ldns_dname_cat_clone (dname.c) does not check if the resulting domain name is too long. I'm not sure if this is by design. 3. ldns_pkt_push_rr (packet.c) does not check for errors, and always returns true. I'm attaching a patch to fix these problems (it's rather trivial), hope you'll find it useful. -------------- next part -------------- diff --git a/dname.c b/dname.c --- a/dname.c +++ b/dname.c @@ -53,6 +53,9 @@ /* we overwrite the nullbyte of rd1 */ new_size = left_size + ldns_rdf_size(rd2); + if (new_size > LDNS_MAX_DOMAINLEN) { + return NULL; + } buf = LDNS_XMALLOC(uint8_t, new_size); if (!buf) { return NULL; diff --git a/packet.c b/packet.c --- a/packet.c +++ b/packet.c @@ -649,19 +649,27 @@ { switch(section) { case LDNS_SECTION_QUESTION: - ldns_rr_list_push_rr(ldns_pkt_question(packet), rr); + if (!ldns_rr_list_push_rr(ldns_pkt_question(packet), rr)) { + return false; + } ldns_pkt_set_qdcount(packet, ldns_pkt_qdcount(packet) + 1); break; case LDNS_SECTION_ANSWER: - ldns_rr_list_push_rr(ldns_pkt_answer(packet), rr); + if (!ldns_rr_list_push_rr(ldns_pkt_answer(packet), rr)) { + return false; + } ldns_pkt_set_ancount(packet, ldns_pkt_ancount(packet) + 1); break; case LDNS_SECTION_AUTHORITY: - ldns_rr_list_push_rr(ldns_pkt_authority(packet), rr); + if (!ldns_rr_list_push_rr(ldns_pkt_authority(packet), rr)) { + return false; + } ldns_pkt_set_nscount(packet, ldns_pkt_nscount(packet) + 1); break; case LDNS_SECTION_ADDITIONAL: - ldns_rr_list_push_rr(ldns_pkt_additional(packet), rr); + if (!ldns_rr_list_push_rr(ldns_pkt_additional(packet), rr)) { + return false; + } ldns_pkt_set_arcount(packet, ldns_pkt_arcount(packet) + 1); break; case LDNS_SECTION_ANY: diff --git a/resolver.c b/resolver.c --- a/resolver.c +++ b/resolver.c @@ -1333,17 +1333,22 @@ ldns_resolver_nameservers_randomize(ldns_resolver *r) { uint16_t i, j; - ldns_rdf **ns, *tmp; + ldns_rdf **ns, *tmpns; + size_t *rtt, tmprtt; /* should I check for ldns_resolver_random?? */ assert(r != NULL); ns = ldns_resolver_nameservers(r); + rtt = ldns_resolver_rtt(r); for (i = 0; i < ldns_resolver_nameserver_count(r); i++) { j = ldns_get_random() % ldns_resolver_nameserver_count(r); - tmp = ns[i]; + tmpns = ns[i]; ns[i] = ns[j]; - ns[j] = tmp; + ns[j] = tmpns; + tmprtt = rtt[i]; + rtt[i] = rtt[j]; + rtt[j] = tmprtt; } ldns_resolver_set_nameservers(r, ns); } From willem at nlnetlabs.nl Tue Aug 21 08:46:32 2012 From: willem at nlnetlabs.nl (Willem Toorop) Date: Tue, 21 Aug 2012 10:46:32 +0200 Subject: [ldns-users] ldns_resolver_pop_nameserver and ldns_resolver_deep_free In-Reply-To: <5010F8C1.7030104@durchmesser.ch> References: <5010F8C1.7030104@durchmesser.ch> Message-ID: <50334AE8.8070102@nlnetlabs.nl> Hi Marius, I have fixed it by testing for ns_count == 1 in ldns_resolver_pop_nameserver which I believe is more understandable at first sight (you don't need to know realloc with size 0 equals free :). Thanks for noticing and reporting! -- Willem Index: resolver.c =================================================================== --- resolver.c (revision 3708) +++ resolver.c (working copy) @@ -253,13 +253,20 @@ pop = nameservers[ns_count - 1]; - nameservers = LDNS_XREALLOC(nameservers, ldns_rdf *, (ns_count - 1)); - rtt = LDNS_XREALLOC(rtt, size_t, (ns_count - 1)); + if (ns_count == 1) { + LDNS_FREE(nameservers); + LDNS_FREE(rtt); - if(nameservers) + ldns_resolver_set_nameservers(r, NULL); + ldns_resolver_set_rtt(r, NULL); + } else { + nameservers = LDNS_XREALLOC(nameservers, ldns_rdf *, + (ns_count - 1)); + rtt = LDNS_XREALLOC(rtt, size_t, (ns_count - 1)); + ldns_resolver_set_nameservers(r, nameservers); - if(rtt) ldns_resolver_set_rtt(r, rtt); + } /* decr the count */ ldns_resolver_dec_nameserver_count(r); return pop; Op 26-07-12 09:58, Marius Rieder schreef: > Hi, > > If i remove all nameserver with ldns_resolver_pop_nameserver and > do a ldns_resolver_deep_free later. Ldns double frees the > r->_nameservers and r->_rtt. > > ldns_resolver_pop_nameserver reallocs [1]boath with size 0, which is a > equivalent to free. Which is perfect fine, but do not update the pointer > in the ldns_resolver. > > [1]http://www.nlnetlabs.nl/projects/ldns/doc/resolver_8c_source.html#l00256 > > As realloc could return NULL in case of a failed realloc aswell, it may > be nessesary to check the ns_count eigther in > ldns_resolver_pop_nameserver or ldns_resolver_deep_free. > > - Marius > From willem at nlnetlabs.nl Tue Aug 21 09:22:40 2012 From: willem at nlnetlabs.nl (Willem Toorop) Date: Tue, 21 Aug 2012 11:22:40 +0200 Subject: [ldns-users] pyLDNS fixes in ldns_buffer, ldns_rdf, ldns_dname and others In-Reply-To: <5017D3AE.50707@nic.cz> References: <5017D3AE.50707@nic.cz> Message-ID: <50335360.5040208@nlnetlabs.nl> Hi Karel, Thanks again for your contributions! They are in revision 3710. Maybe it would be nice to have the description of your fixes and improvements in trunk/contrib/python/Changelog ? Cheers, -- Willem Op 31-07-12 14:46, Karel Slany schreef: > Hello, > > I've written three scripts testing the functionality of ldns_buffer, > ldns_rdf and ldns_dname Python classes. By running the scripts I've > encountered several problems which have been fixed in the attached > patch. The patch also contains the mentioned testing scripts, which need > to be added into the repository in order to prevent breaking the > functionality by code changes in future. So please don't forget to: > > svn add trunk/contrib/python/examples/test_*.py > chmod +x trunk/contrib/python/examples/test_*.py > > Description of the fixed issues follows. > > Python 3 related: > * Fixed automatic conversion from string to ldns_rdf and ldns_dname. > Caused memory corruption when using Python 3. The #ifdef > SWIG_Python_str_AsChar does not actually work as SWIG_Python_str_AsChar > is a function (at least in SWIG 2.0.4), so it has been replaced. Also in > Python 3 the conversion would have caused memory leaks if it was working. > * In Python 3 the wrapper now raises TypeError instead of ValueError > when receiving a non FILE * argument when it should receive a FILE * > argument. In Python 2 it raises TypeError by default, so it was changed > to comply with Python 2. > > Python serious issues: > * Fixed wrong handling of _ldns_rr_list_free() and > _ldns_rr_list_deep_free() when compiling with LDNS_DEBUG directive. > * Fixed malfunctioning ldns.ldns_rdf_new_frm_fp_l(). > * Fixed malfunctioning ldns_drf.absolute() and ldns_dname.absolute() > * Marked several functions related to ldns_rdf and ldns_buffer as > returning new objects. It could lead to memory leaks, when not marked. > (ldns_rdf.address_reverse(), ldns_rdf.cat_clone(), etc.) > * And many small fixes preventing code crashes in ldns_buffer, ldns_rdf > and ldns_dname. > > Interface fixes and additions: > * Method operating on ldns_dnames and returning dname ldns_rdfs now > return ldns_dname instances. (This represents no compatibility issues, > as ldns_dname is derived from ldns_rdf.) > * Improved documentation of ldns_buffer, ldns_rdf and ldns_dname classes. > * Methods ldns_buffer.available() and ldns_buffer.available_at() now > return bool types as described in the documentation. > * Added scripts for testing of basic functionality of the classes > ldns_buffer, ldns_rdf, ldns_dname. > * Added deprecation warnings to ldns_rdf methods operating on dname > rdfs. The user is encouraged to converts dname ldns_rdfs to ldns_dnames. > This saves several lines of sanity checking code in future. > * Extended ldns_dname constructor to accept ldns_rdfs containing dnames. > > I've tested the changes using Python 2.7 and 3.2. The changes maintain > backward compatibility. However, in several cases the code will now > throw a deprecation warning about changes of the interface in future. > > Best regards, > K. > > > > _______________________________________________ > ldns-users mailing list > ldns-users at open.nlnetlabs.nl > http://open.nlnetlabs.nl/mailman/listinfo/ldns-users > From willem at nlnetlabs.nl Wed Aug 22 09:53:30 2012 From: willem at nlnetlabs.nl (Willem Toorop) Date: Wed, 22 Aug 2012 11:53:30 +0200 Subject: [ldns-users] ldns_buffer2str asserting after ldns_buffer_copy In-Reply-To: <5009528F.7080200@nic.cz> References: <5009528F.7080200@nic.cz> Message-ID: <5034AC1A.6060500@nlnetlabs.nl> Hi Karel, The behaviour of those ldns_buffer functions is indeed non-intuitive and was erroneous at some places as well. The problem with your example program was that ldns_buffer2str used the function ldns_buffer_export which would fix the buffer. Though, this was not necessary at all since ldns_buffer2str would return a copy of the data in the buffer. I have fixed ldns_buffer2str to use ldns_buffer_begin i.s.o. ldns_buffer_export and created a new function ldns_buffer_export2str that actually returns the exported buffer data (null-terminated of course) and does not return a copy. The problem with ldns_buffer_copy is that it returns a flipped destination buffer. Flipped buffers are buffers that are ready for sequential reading. The ldns library does not use this modus operandi, and nor do the example tools, but unbound does. The buffer handling functions in ldns (like ldns_buffer2str) do not expect buffers to be flipped. It is thus not recommended to use ldns_buffer_flip and ldns_buffer_copy (expect when your only going to use the ldns_buffer_read_* functions). In stead of using ldns_buffer_copy you could use: ldns_buffer_clear(b1); ldns_buffer_write(b1, ldns_buffer_begin(b2), ldns_buffer_position(b2)); I also updated the documentation of ldns_buffer_copy and ldns_buffer2str to make them more clear. Updates are in revision 3711. Best regards, -- Willem Op 20-07-12 14:43, Karel Slany schreef: > Hello again, > > I'm writing some scripts for automated checking of pyLDNS basic > functionality. I have encountered strange behaviour of the > ldns_buffer_copy and ldns_buffer2str function. > > ldns_buffer: ./buffer.c:82: ldns_buffer_reserve: Assertion > `!buffer->_fixed' failed. > > I am not sure whether this is a bug or I am missing something. But I > haven't found any clues in the documentation telling me why this > shouldn't work. > > I've rewritten the code to C, in order to make it more understandable: > > #include > #include > > int main(void) > { > ldns_buffer *b1, *b2; > char *str; > > b1 = ldns_buffer_new(1024); > b2 = ldns_buffer_new(10); > > ldns_buffer_printf(b1, "%s", "abc"); > ldns_buffer_printf(b2, "%s", "def"); > > str = ldns_buffer2str(b1); > fprintf(stdout, "b1: %s\n", str); > LDNS_FREE(str); > > str = ldns_buffer2str(b2); > fprintf(stdout, "b2: %s\n", str); > LDNS_FREE(str); > > ldns_buffer_copy(b1, b2); > > str = ldns_buffer2str(b1); /* Asserts here. */ > fprintf(stdout, "b1: %s\n", str); > LDNS_FREE(str); > > str = ldns_buffer2str(b2); > fprintf(stdout, "b2: %s\n", str); > LDNS_FREE(str); > > ldns_buffer_free(b1); > ldns_buffer_free(b2); > } > > The comment shows the position, where the code is asserting. > > I've tested ldns 1.6.13 and also the latest SVN (revision 3707), both > behave the same. > > K. > _______________________________________________ > ldns-users mailing list > ldns-users at open.nlnetlabs.nl > http://open.nlnetlabs.nl/mailman/listinfo/ldns-users > From willem at nlnetlabs.nl Wed Aug 22 12:22:00 2012 From: willem at nlnetlabs.nl (Willem Toorop) Date: Wed, 22 Aug 2012 14:22:00 +0200 Subject: [ldns-users] Various fixes In-Reply-To: References: Message-ID: <5034CEE8.4030306@nlnetlabs.nl> Hello Vitaly, Op 05-08-12 20:32, Vitaly Magerya schreef: > Hi, folks. I've been writing a bind9-host replacement using ldns, > and there's a number of problems with the library I've run into: Interesting. Will it be open source? Is there a webpage for it? > 1. ldns_resolver_nameservers_randomize (resolver.c) shuffles > _nameservers array, but does not shuffle _rtt array; I think > both arrays should be kept in sync. Absolutely. > 2. ldns_dname_cat_clone (dname.c) does not check if the resulting > domain name is too long. I'm not sure if this is by design. I'm not including your fix for this, because the checks for LDNS_MAX_DOMAINLEN are already in the conversion functions (from and to host, str and wire). Also ldns_dname_cat_clone might be used for intermediate operations and doesn't necessarily have to return a standards compliant dname (yet). > 3. ldns_pkt_push_rr (packet.c) does not check for errors, and > always returns true. Indeed. > I'm attaching a patch to fix these problems (it's rather trivial), > hope you'll find it useful. Very, thanks! Applied in revision 3712 -- Willem From vmagerya at gmail.com Wed Aug 22 15:26:40 2012 From: vmagerya at gmail.com (Vitaly Magerya) Date: Wed, 22 Aug 2012 18:26:40 +0300 Subject: [ldns-users] Various fixes In-Reply-To: <5034CEE8.4030306@nlnetlabs.nl> References: <5034CEE8.4030306@nlnetlabs.nl> Message-ID: illem Toorop wrote: > Op 05-08-12 20:32, Vitaly Magerya schreef: >> Hi, folks. I've been writing a bind9-host replacement using ldns, >> and there's a number of problems with the library I've run into: > > Interesting. Will it be open source? Is there a webpage for it? Yes. See [1]. >> 2. ldns_dname_cat_clone (dname.c) does not check if the resulting >> domain name is too long. I'm not sure if this is by design. > > I'm not including your fix for this, because the checks for > LDNS_MAX_DOMAINLEN are already in the conversion functions (from and to > host, str and wire). Also ldns_dname_cat_clone might be used for > intermediate operations and doesn't necessarily have to return a > standards compliant dname (yet). Ah, OK. [1] http://tx97.net/ldns-host/ From miek at miek.nl Thu Aug 23 07:07:58 2012 From: miek at miek.nl (Miek Gieben) Date: Thu, 23 Aug 2012 09:07:58 +0200 Subject: [ldns-users] Various fixes In-Reply-To: References: <5034CEE8.4030306@nlnetlabs.nl> Message-ID: <20120823070758.GB29368@miek.nl> [ Quoting in "Re: [ldns-users] Various fixes..." ] > illem Toorop wrote: > > Op 05-08-12 20:32, Vitaly Magerya schreef: > >> Hi, folks. I've been writing a bind9-host replacement using ldns, > >> and there's a number of problems with the library I've run into: > > > > Interesting. Will it be open source? Is there a webpage for it? > > Yes. See [1]. Looking at the code I see some functions, like: dns_rdf_reverse_aaaa and ldns_rdf_reverse_a, of which I wonder. Why didn't you use ldns_rdf_address_reverse? Same question for ldns_pkt_push_rr_soa, as there is ldns_pkt_push_rr? grtz Miek -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From vmagerya at gmail.com Thu Aug 23 09:52:30 2012 From: vmagerya at gmail.com (Vitaly Magerya) Date: Thu, 23 Aug 2012 12:52:30 +0300 Subject: [ldns-users] Various fixes In-Reply-To: <20120823070758.GB29368@miek.nl> References: <5034CEE8.4030306@nlnetlabs.nl> <20120823070758.GB29368@miek.nl> Message-ID: <5035FD5E.1010909@gmail.com> Miek Gieben wrote: > Looking at the code This is appreciated, thank you. > I see some functions, like: > > dns_rdf_reverse_aaaa and ldns_rdf_reverse_a, of which I wonder. Why > didn't you use ldns_rdf_address_reverse? ldns_rdf_address_reverse always uses IP6.ARPA domain when reversing IPv6 addresses, while bind9-host (and thus ldns-host) allows choosing between IP6.ARPA and IP6.INT. > Same question for ldns_pkt_push_rr_soa, > as there is ldns_pkt_push_rr? ldns_pkt_push_rr_soa actually constructs a SOA RR (by most notably setting the serial number) and then calls ldns_pkt_push_rr. Maybe I'm missing an easier way to construct a SOA RR? I need that to send IXFR queries, which are invalid without an additional SOA record in the request packet. From miek at miek.nl Thu Aug 23 10:34:33 2012 From: miek at miek.nl (Miek Gieben) Date: Thu, 23 Aug 2012 12:34:33 +0200 Subject: [ldns-users] Various fixes In-Reply-To: <5035FD5E.1010909@gmail.com> References: <5034CEE8.4030306@nlnetlabs.nl> <20120823070758.GB29368@miek.nl> <5035FD5E.1010909@gmail.com> Message-ID: <20120823103433.GB25814@miek.nl> [ Quoting in "Re: [ldns-users] Various fixes..." ] > > dns_rdf_reverse_aaaa and ldns_rdf_reverse_a, of which I wonder. Why > > didn't you use ldns_rdf_address_reverse? > > ldns_rdf_address_reverse always uses IP6.ARPA domain when reversing IPv6 > addresses, while bind9-host (and thus ldns-host) allows choosing between > IP6.ARPA and IP6.INT. OK. But you are aware that IP6.INT has been deprecated long ago? https://www.ietf.org/rfc/rfc4159.txt > > Same question for ldns_pkt_push_rr_soa, > > as there is ldns_pkt_push_rr? > > ldns_pkt_push_rr_soa actually constructs a SOA RR (by most notably > setting the serial number) and then calls ldns_pkt_push_rr. > > Maybe I'm missing an easier way to construct a SOA RR? I need that to > send IXFR queries, which are invalid without an additional SOA record in > the request packet. Ah, I see. No, I don't think there is a convenience function for that in ldns. grtz Miek -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From vmagerya at gmail.com Thu Aug 23 10:57:27 2012 From: vmagerya at gmail.com (Vitaly Magerya) Date: Thu, 23 Aug 2012 13:57:27 +0300 Subject: [ldns-users] Various fixes In-Reply-To: <20120823103433.GB25814@miek.nl> References: <5034CEE8.4030306@nlnetlabs.nl> <20120823070758.GB29368@miek.nl> <5035FD5E.1010909@gmail.com> <20120823103433.GB25814@miek.nl> Message-ID: <50360C97.6060009@gmail.com> Miek Gieben wrote: >> ldns_rdf_address_reverse always uses IP6.ARPA domain when reversing IPv6 >> addresses, while bind9-host (and thus ldns-host) allows choosing between >> IP6.ARPA and IP6.INT. > > OK. But you are aware that IP6.INT has been deprecated long ago? > https://www.ietf.org/rfc/rfc4159.txt I am. I still want to support it though, since a major goal of ldns-host is to be a drop-in replacement for bind9-host. From drc at virtualized.org Fri Aug 24 23:03:37 2012 From: drc at virtualized.org (David Conrad) Date: Fri, 24 Aug 2012 16:03:37 -0700 Subject: [ldns-users] Various fixes In-Reply-To: <50360C97.6060009@gmail.com> References: <5034CEE8.4030306@nlnetlabs.nl> <20120823070758.GB29368@miek.nl> <5035FD5E.1010909@gmail.com> <20120823103433.GB25814@miek.nl> <50360C97.6060009@gmail.com> Message-ID: <774EECB5-7383-4D91-9631-BB3077ED229D@virtualized.org> On Aug 23, 2012, at 3:57 AM, Vitaly Magerya wrote: > Miek Gieben wrote: >>> ldns_rdf_address_reverse always uses IP6.ARPA domain when reversing IPv6 >>> addresses, while bind9-host (and thus ldns-host) allows choosing between >>> IP6.ARPA and IP6.INT. >> >> OK. But you are aware that IP6.INT has been deprecated long ago? >> https://www.ietf.org/rfc/rfc4159.txt > > I am. I still want to support it though, since a major goal of ldns-host > is to be a drop-in replacement for bind9-host. Sorry, what's the point? ip6.int isn't delegated. The fact that host from ISC continues to support it is a bug. Regards, -drc From vmagerya at gmail.com Sat Aug 25 18:32:22 2012 From: vmagerya at gmail.com (Vitaly Magerya) Date: Sat, 25 Aug 2012 21:32:22 +0300 Subject: [ldns-users] Various fixes In-Reply-To: <774EECB5-7383-4D91-9631-BB3077ED229D@virtualized.org> References: <5034CEE8.4030306@nlnetlabs.nl> <20120823070758.GB29368@miek.nl> <5035FD5E.1010909@gmail.com> <20120823103433.GB25814@miek.nl> <50360C97.6060009@gmail.com> <774EECB5-7383-4D91-9631-BB3077ED229D@virtualized.org> Message-ID: David Conrad wrote: >>> OK. But you are aware that IP6.INT has been deprecated long ago? >>> https://www.ietf.org/rfc/rfc4159.txt >> >> I am. I still want to support it though, since a major goal of ldns-host >> is to be a drop-in replacement for bind9-host. > > Sorry, what's the point? ip6.int isn't delegated. The fact that host from > ISC continues to support it is a bug. It's the same as with other compatibility efforts: to save a day of debugging for some poor soul stuck with maintaining crazy code base behind a misconfigured DNS server, that relies on a particular behavior of "host -i". Case in point: $ host -i ::1 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.int domain name pointer localhost. From miek at miek.nl Sat Aug 25 18:56:04 2012 From: miek at miek.nl (Miek Gieben) Date: Sat, 25 Aug 2012 20:56:04 +0200 Subject: [ldns-users] Various fixes In-Reply-To: References: <5034CEE8.4030306@nlnetlabs.nl> <20120823070758.GB29368@miek.nl> <5035FD5E.1010909@gmail.com> <20120823103433.GB25814@miek.nl> <50360C97.6060009@gmail.com> <774EECB5-7383-4D91-9631-BB3077ED229D@virtualized.org> Message-ID: <20120825185604.GA14460@miek.nl> [ Quoting in "Re: [ldns-users] Various fixes..." ] > > Sorry, what's the point? ip6.int isn't delegated. The fact that host from > > ISC continues to support it is a bug. > > It's the same as with other compatibility efforts: to save a day > of debugging for some poor soul stuck with maintaining crazy > code base behind a misconfigured DNS server, that relies on a > particular behavior of "host -i". > > Case in point: > > $ host -i ::1 > 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.int > domain name pointer localhost. Now I don't get this... This example is live on your system? Because if I do this: % host -i ::1 Host 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.int not found: 3(NXDOMAIN) Which proves David's point...? Regards, -- Miek Gieben http://miek.nl -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From vmagerya at gmail.com Sat Aug 25 19:17:53 2012 From: vmagerya at gmail.com (Vitaly Magerya) Date: Sat, 25 Aug 2012 22:17:53 +0300 Subject: [ldns-users] Various fixes In-Reply-To: <20120825185604.GA14460@miek.nl> References: <5034CEE8.4030306@nlnetlabs.nl> <20120823070758.GB29368@miek.nl> <5035FD5E.1010909@gmail.com> <20120823103433.GB25814@miek.nl> <50360C97.6060009@gmail.com> <774EECB5-7383-4D91-9631-BB3077ED229D@virtualized.org> <20120825185604.GA14460@miek.nl> Message-ID: Miek Gieben wrote: >> $ host -i ::1 >> 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.int >> domain name pointer localhost. > > Now I don't get this... This example is live on your system? Yes. > Which proves David's point...? No, he's right, ip6.int is not globally delegated. Locally on the other hand, there are DNS servers configured to return meaningful results. From miek at miek.nl Sat Aug 25 19:20:32 2012 From: miek at miek.nl (Miek Gieben) Date: Sat, 25 Aug 2012 21:20:32 +0200 Subject: [ldns-users] Various fixes In-Reply-To: References: <5034CEE8.4030306@nlnetlabs.nl> <20120823070758.GB29368@miek.nl> <5035FD5E.1010909@gmail.com> <20120823103433.GB25814@miek.nl> <50360C97.6060009@gmail.com> <774EECB5-7383-4D91-9631-BB3077ED229D@virtualized.org> <20120825185604.GA14460@miek.nl> Message-ID: <20120825192031.GB14460@miek.nl> [ Quoting in "Re: [ldns-users] Various fixes..." ] > >Which proves David's point...? > > for years, almost as long as netstat and ifconfig/route. Maybe we can > hope bind10 won't ship them anymore :) *decided to look* % pwd /tmp/bind10/src/bin/host % cat README Rewriting host(1) in C++ from scratch using BIND 10's libdns++. The bugs and incompatibilities are listed in the manual page and in the source code. Noooooooooooooo!!!!!!1!!! Regards, -- Miek Gieben http://miek.nl -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From paul at nohats.ca Sat Aug 25 19:15:10 2012 From: paul at nohats.ca (Paul Wouters) Date: Sat, 25 Aug 2012 15:15:10 -0400 (EDT) Subject: [ldns-users] Various fixes In-Reply-To: <20120825185604.GA14460@miek.nl> References: <5034CEE8.4030306@nlnetlabs.nl> <20120823070758.GB29368@miek.nl> <5035FD5E.1010909@gmail.com> <20120823103433.GB25814@miek.nl> <50360C97.6060009@gmail.com> <774EECB5-7383-4D91-9631-BB3077ED229D@virtualized.org> <20120825185604.GA14460@miek.nl> Message-ID: On Sat, 25 Aug 2012, Miek Gieben wrote: >> It's the same as with other compatibility efforts: to save a day >> of debugging for some poor soul stuck with maintaining crazy >> code base behind a misconfigured DNS server, that relies on a >> particular behavior of "host -i". >> >> Case in point: >> >> $ host -i ::1 >> 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.int >> domain name pointer localhost. > > Now I don't get this... This example is live on your system? > > Because if I do this: > > % host -i ::1 > Host 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.int not found: 3(NXDOMAIN) > > Which proves David's point...? Same here. Also, the "host" and "nslookup" command have been deprecated for years, almost as long as netstat and ifconfig/route. Maybe we can hope bind10 won't ship them anymore :) Paul From drc at virtualized.org Mon Aug 27 18:00:53 2012 From: drc at virtualized.org (David Conrad) Date: Mon, 27 Aug 2012 11:00:53 -0700 Subject: [ldns-users] Various fixes In-Reply-To: References: <5034CEE8.4030306@nlnetlabs.nl> <20120823070758.GB29368@miek.nl> <5035FD5E.1010909@gmail.com> <20120823103433.GB25814@miek.nl> <50360C97.6060009@gmail.com> <774EECB5-7383-4D91-9631-BB3077ED229D@virtualized.org> <20120825185604.GA14460@miek.nl> Message-ID: On Aug 25, 2012, at 12:15 PM, Paul Wouters wrote: > Same here. Also, the "host" and "nslookup" command have been deprecated > for years, almost as long as netstat and ifconfig/route. Maybe we can > hope bind10 won't ship them anymore :) We tried that with BIND9 (at least for nslookup). The reaction from "the community" was strongly negative. Seems too many people have incorporated nslookup into scripts (when you think the only tool you have is a hammer...). I'd be surprised if they can be exorcised out of BIND10. Regards, -drc From karel.slany at nic.cz Thu Aug 30 14:44:17 2012 From: karel.slany at nic.cz (Karel Slany) Date: Thu, 30 Aug 2012 16:44:17 +0200 Subject: [ldns-users] pyLDNS fixes in ldns_rr, ldns_rr_list, ldns_rr_descriptor Message-ID: <503F7C41.90701@nic.cz> 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: From willem at nlnetlabs.nl Fri Aug 31 12:29:27 2012 From: willem at nlnetlabs.nl (Willem Toorop) Date: Fri, 31 Aug 2012 14:29:27 +0200 Subject: [ldns-users] pyLDNS fixes in ldns_rr, ldns_rr_list, ldns_rr_descriptor In-Reply-To: <503F7C41.90701@nic.cz> References: <503F7C41.90701@nic.cz> Message-ID: <5040AE27.6040404@nlnetlabs.nl> Excellent, Thanks! Committed. -- Willem Op 30-08-12 16:44, Karel Slany schreef: > 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. > > > > _______________________________________________ > ldns-users mailing list > ldns-users at open.nlnetlabs.nl > http://open.nlnetlabs.nl/mailman/listinfo/ldns-users >