]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
rr_frm_str can now also handle question RRs (i.e. without rdata)
authorJelte Jansen <jeltejan@NLnetLabs.nl>
Tue, 8 Nov 2005 11:06:29 +0000 (11:06 +0000)
committerJelte Jansen <jeltejan@NLnetLabs.nl>
Tue, 8 Nov 2005 11:06:29 +0000 (11:06 +0000)
removed error when parsing zonefiles and a line does not contain an RR

rr.c
zone.c

diff --git a/rr.c b/rr.c
index d0d51186187cb09633d0085b61f1d6ab535b977a..2f965c5258c997c360cdec9d8e49df4d6d0394d2 100644 (file)
--- a/rr.c
+++ b/rr.c
@@ -225,6 +225,8 @@ ldns_rr_new_frm_str(const char *str, uint16_t default_ttl, ldns_rdf *origin)
        }
        
        if (ldns_bget_token(rr_buf, rdata, "\0", LDNS_MAX_PACKETLEN) == -1) {
+               /* apparently we are done, and it's only a question RR
+                * so do not free and error here
                LDNS_FREE(owner); 
                LDNS_FREE(ttl); 
                LDNS_FREE(clas); 
@@ -235,6 +237,7 @@ ldns_rr_new_frm_str(const char *str, uint16_t default_ttl, ldns_rdf *origin)
                ldns_buffer_free(rr_buf);
                ldns_rr_free(new);
                return NULL;
+               */
        }
 
        ldns_buffer_new_frm_data(
diff --git a/zone.c b/zone.c
index b7f351b8105f56c0e304415837675b5bc301136f..301dba7d92ac359622c797400aeff4fa6fa385eb 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -231,6 +231,9 @@ ldns_zone_new_frm_fp_l(FILE *fp, ldns_rdf *origin, uint16_t ttl, ldns_rr_class c
                        my_class  = ldns_rr_get_class(rr);
                        
                } else {
+                       /* hmz if $ORIGIN was read there is no RR either */
+                       /* we need to add a feedbacking function */
+                       /*
                        fprintf(stderr, "Error in file, unable to read RR");
                        if (line_nr) {
                                fprintf(stderr, " at line %d.\n", *line_nr);
@@ -241,6 +244,7 @@ ldns_zone_new_frm_fp_l(FILE *fp, ldns_rdf *origin, uint16_t ttl, ldns_rr_class c
                        fprintf(stderr, "Last rr that was parsed:\n");
                        ldns_rr_print(stderr, last_rr);
                        dprintf("%s", "\n");
+                       */
                }
        }
        if (my_origin) {