mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-11 04:17:42 +02:00
parse sldns_get_rr_class_by_name and sldns_get_rr_type_by_name return value 0
This commit is contained in:
@@ -229,6 +229,10 @@ make_query(char* qname, char* qtype, char* qclass)
|
||||
|
||||
qinfo.qtype = sldns_get_rr_type_by_name(qtype);
|
||||
qinfo.qclass = sldns_get_rr_class_by_name(qclass);
|
||||
if((qinfo.qtype == 0 && strcmp(qtype, "TYPE0") != 0) ||
|
||||
(qinfo.qclass == 0 && strcmp(qclass, "CLASS0") != 0)) {
|
||||
return 0;
|
||||
}
|
||||
qinfo.local_alias = NULL;
|
||||
|
||||
qinfo_query_encode(buf, &qinfo); /* flips buffer */
|
||||
|
||||
@@ -458,9 +458,17 @@ qlist_parse_line(sldns_buffer* buf, char* p)
|
||||
if(strcmp(tp, "IN") == 0 || strcmp(tp, "CH") == 0) {
|
||||
qinfo.qtype = sldns_get_rr_type_by_name(cl);
|
||||
qinfo.qclass = sldns_get_rr_class_by_name(tp);
|
||||
if((qinfo.qtype == 0 && strcmp(cl, "TYPE0") != 0) ||
|
||||
(qinfo.qclass == 0 && strcmp(tp, "CLASS0") != 0)) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
qinfo.qtype = sldns_get_rr_type_by_name(tp);
|
||||
qinfo.qclass = sldns_get_rr_class_by_name(cl);
|
||||
if((qinfo.qtype == 0 && strcmp(tp, "TYPE0") != 0) ||
|
||||
(qinfo.qclass == 0 && strcmp(cl, "CLASS0") != 0)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if(fl[0] == '+') rec = 1;
|
||||
else if(fl[0] == '-') rec = 0;
|
||||
|
||||
@@ -133,6 +133,10 @@ write_q(int fd, int udp, SSL* ssl, sldns_buffer* buf, uint16_t id,
|
||||
/* qtype and qclass */
|
||||
qinfo.qtype = sldns_get_rr_type_by_name(strtype);
|
||||
qinfo.qclass = sldns_get_rr_class_by_name(strclass);
|
||||
if((qinfo.qtype == 0 && strcmp(strtype, "TYPE0") != 0) ||
|
||||
(qinfo.qclass == 0 && strcmp(strclass, "CLASS0") != 0)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* clear local alias */
|
||||
qinfo.local_alias = NULL;
|
||||
|
||||
Reference in New Issue
Block a user