]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
origin is now really read from soa if not specified
authorJelte Jansen <jeltejan@NLnetLabs.nl>
Thu, 18 Aug 2005 09:06:52 +0000 (09:06 +0000)
committerJelte Jansen <jeltejan@NLnetLabs.nl>
Thu, 18 Aug 2005 09:06:52 +0000 (09:06 +0000)
fixed comment issue between () (like it is often the case in soa records)
fixed WKS reading when protocol is specified with integer instead of mnemonic

parse.c
str2host.c
zone.c

diff --git a/parse.c b/parse.c
index df949fcf99b3db5b90f5de3135021a943f39f171..367fea68d38e7a0cce50df7954f058fcd06250d7 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -133,8 +133,11 @@ ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *li
                        if (line_nr) {
                                *line_nr = *line_nr + 1;
                        }
-                       /* enter marks end of comment */
-                       goto tokenread;
+                       if (p == 0) {
+                               goto tokenread;
+                       } else {
+                               continue;
+                       }
                }
 
                if (com == 1) {
index fae2930261ebdb2795b00ef15c20d75362336687..573b8aa48b7c6c50733a3823a72d4d061654d7b3 100644 (file)
@@ -798,7 +798,11 @@ ldns_str2rdf_wks(ldns_rdf **rd, const char *str)
        
        data = LDNS_XMALLOC(uint8_t, bm_len + 1);
        proto = getprotobyname(proto_str);
-       data[0] = (uint8_t) proto->p_proto;
+       if (proto) {
+               data[0] = (uint8_t) proto->p_proto;
+       } else {
+               data[0] = (uint8_t) atoi(proto_str);
+       }
        memcpy(data + 1, bitmap, (size_t) bm_len);
        
        *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_WKS, (uint16_t) (bm_len + 1), data);
diff --git a/zone.c b/zone.c
index a420c3f2e3d7d55a1c69ef7e33a290bc4f9b970e..18a451760c8e32b05f5831b979af61ca71bd8417 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -128,8 +128,8 @@ ldns_zone_new_frm_fp_l(FILE *fp, ldns_rdf *origin, uint16_t ttl, ldns_rr_class c
 
        ldns_zone_set_soa(newzone, rr);
 
-       if (!origin) {
-               origin = ldns_rr_owner(rr);
+       if (!my_origin) {
+               my_origin = ldns_rr_owner(rr);
        }
 
        while(!feof(fp)) {