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
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) {
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);
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)) {