From: Jelte Jansen Date: Thu, 18 Aug 2005 09:06:52 +0000 (+0000) Subject: origin is now really read from soa if not specified X-Git-Tag: release-1.0.0~270 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da7d074b7b6d0c7b373fb2d0f1973e0b79584ea4;p=thirdparty%2Fldns.git origin is now really read from soa if not specified 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 --- diff --git a/parse.c b/parse.c index df949fcf..367fea68 100644 --- 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) { diff --git a/str2host.c b/str2host.c index fae29302..573b8aa4 100644 --- a/str2host.c +++ b/str2host.c @@ -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 a420c3f2..18a45176 100644 --- 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)) {