From paul at xelerance.com Wed Jun 3 01:16:15 2009 From: paul at xelerance.com (Paul Wouters) Date: Tue, 2 Jun 2009 21:16:15 -0400 (EDT) Subject: [ldns-users] ldns-read-zone feature request Message-ID: Hey, I want to be able to increase the serial number of a zone, after a zone has been preprocessed using ldns-read-zone. The method I am using is mmap(), as this allows me to only write a few bytes to disk, without the need to read in a potential very large zone. However, that only works when I don't need to insert character, because then the mmap won't work without needing to copy the entire file. So zones where the serial number increases by a digit are a problem for me. So my feature request is for ldns-read-zone to prepend spaces so that the serial number makes up 10 characters in the output regardless of the serial number. I tried to find the proper place in the ldns code, but I lost track somewhere between ldns_rr_print() and ldns_rr2buffer_str() Paul From jakob at rfc.se Wed Jun 3 07:09:46 2009 From: jakob at rfc.se (Jakob Schlyter) Date: Wed, 3 Jun 2009 09:09:46 +0200 Subject: [ldns-users] ldns-read-zone feature request In-Reply-To: References: Message-ID: <6F35AF14-9CAF-4A6A-A78F-EDDCA73E2BB0@rfc.se> On 3 jun 2009, at 03.16, Paul Wouters wrote: > I want to be able to increase the serial number of a zone, after a > zone > has been preprocessed using ldns-read-zone. The method I am using is > mmap(), as this allows me to only write a few bytes to disk, without > the need to read in a potential very large zone. or just write a ldns-read-zone look-a-like that does what ldns-read- zone does but also does some soa serial magic before output? (increase+ +, set YYYYMMDDxx, unix-timestamp) jakob From marius.rieder at durchmesser.ch Mon Jun 29 10:31:11 2009 From: marius.rieder at durchmesser.ch (Marius Rieder) Date: Mon, 29 Jun 2009 12:31:11 +0200 Subject: [ldns-users] memleak in ldns_rr_list_subtype_by_rdf Message-ID: <4A4897EF.1070709@durchmesser.ch> Hi ldns_rr_list_subtype_by_rdf return NULL if no rr has matched, but don't free the created ldns_rr_list *subtyped; It's just "24 bytes in 1 blocks." but buged me because my program was losing memory. Marius --- rr.c.orig 2009-06-28 21:48:25.000000000 +0200 +++ rr.c 2009-06-29 12:26:23.000000000 +0200 @@ -948,6 +947,7 @@ if (ldns_rr_list_rr_count(subtyped) > 0) { return subtyped; } else { + ldns_rr_list_free(subtyped); return NULL; } } -- ~o__O Marius Rieder O__o~ |vV| http://www.durchmesser.ch/ |vV| /] | | [\ ---/|--|\--------[ Dance first. Think later. ]--------/|--|\--- From marius.rieder at durchmesser.ch Tue Jun 30 13:48:52 2009 From: marius.rieder at durchmesser.ch (Marius Rieder) Date: Tue, 30 Jun 2009 15:48:52 +0200 Subject: [ldns-users] memleak in ldns_rr_list_subtype_by_rdf In-Reply-To: <4A4897EF.1070709@durchmesser.ch> References: <4A4897EF.1070709@durchmesser.ch> Message-ID: <4A4A17C4.4010503@durchmesser.ch> Hi ldns_rr_list_subtype_by_rdf have the same mistake a secount time. in ldns_rr_list_clone may ldns_rr_list_deep_free should be used. In the situation that some rr are allready coned it's leak memory if ldns_rr_clone fails. Index: rr.c =================================================================== --- rr.c (revision 2963) +++ rr.c (working copy) @@ -935,6 +935,7 @@ pos); if (!list_rdf) { /* pos is too large or any other error */ + ldns_rr_list_deep_free(subtyped); return NULL; } @@ -1265,7 +1268,7 @@ ); if (!r) { /* huh, failure in cloning */ - ldns_rr_list_free(new_list); + ldns_rr_list_deep_free(new_list); return NULL; } ldns_rr_list_push_rr(new_list, r); On 6/29/09 12:31 PM, Marius Rieder wrote: > Hi > > ldns_rr_list_subtype_by_rdf return NULL if no rr has matched, but don't > free the created ldns_rr_list *subtyped; > It's just "24 bytes in 1 blocks." but buged me because my program was > losing memory. > > Marius > > --- rr.c.orig 2009-06-28 21:48:25.000000000 +0200 > +++ rr.c 2009-06-29 12:26:23.000000000 +0200 > @@ -948,6 +947,7 @@ > if (ldns_rr_list_rr_count(subtyped) > 0) { > return subtyped; > } else { > + ldns_rr_list_free(subtyped); > return NULL; > } > } > -- ~o__O Marius Rieder O__o~ |vV| http://www.durchmesser.ch/ |vV| /] | | [\ ---/|--|\--------[ Dance first. Think later. ]--------/|--|\--- From jelte at NLnetLabs.nl Tue Jun 30 13:57:09 2009 From: jelte at NLnetLabs.nl (Jelte Jansen) Date: Tue, 30 Jun 2009 15:57:09 +0200 Subject: [ldns-users] memleak in ldns_rr_list_subtype_by_rdf In-Reply-To: <4A4A17C4.4010503@durchmesser.ch> References: <4A4897EF.1070709@durchmesser.ch> <4A4A17C4.4010503@durchmesser.ch> Message-ID: <4A4A19B5.4010702@NLnetLabs.nl> Marius Rieder wrote: > Hi > > ldns_rr_list_subtype_by_rdf have the same mistake a secount time. > in ldns_rr_list_clone may ldns_rr_list_deep_free should be used. In the > situation that some rr are allready coned it's leak memory if > ldns_rr_clone fails. > thanks! I've committed your patches in trunk Jelte