Upstream renamed parse_extract_edns to
parse_extract_edns_from_response_msg and parse_edns_from_pkt to
parse_edns_from_query_pkt in the upcomming libunbound 1.15.0
update. Both funktions work equally well for us but it would look weird
to use the "from_response_msg" function on the query so switch to
parse_edns_from_pkt in preparation for the libunbound update.
OK?
diff --git frontend.c frontend.c
index 1b6333da22c..3a2ee87dea8 100644
--- frontend.c
+++ frontend.c
@@ -734,6 +734,7 @@ void
handle_query(struct pending_query *pq)
{
struct query_imsg query_imsg;
+ struct query_info skip;
struct bl_node find;
int rcode;
char *str;
@@ -773,7 +774,12 @@ handle_query(struct pending_query *pq)
goto send_answer;
}
- rcode = parse_extract_edns(pq->qmsg, &pq->edns, pq->region);
+ sldns_buffer_rewind(pq->qbuf);
+ if (!query_info_parse(&skip, pq->qbuf)) {
+ error_answer(pq, LDNS_RCODE_SERVFAIL);
+ goto send_answer;
+ }
+ rcode = parse_edns_from_pkt(pq->qbuf, &pq->edns, pq->region);
if (rcode != LDNS_RCODE_NOERROR) {
error_answer(pq, rcode);
goto send_answer;
@@ -999,6 +1005,7 @@ void
resend_dns64_query(struct pending_query *opq) {
struct pending_query *pq;
struct query_imsg query_imsg;
+ struct query_info skip;
int rcode;
char dname[LDNS_MAX_DOMAINLEN + 1];
@@ -1059,7 +1066,12 @@ resend_dns64_query(struct pending_query *opq) {
goto drop;
}
- rcode = parse_extract_edns(pq->qmsg, &pq->edns, pq->region);
+ sldns_buffer_rewind(pq->qbuf);
+ if (!query_info_parse(&skip, pq->qbuf)) {
+ error_answer(pq, LDNS_RCODE_SERVFAIL);
+ goto send_answer;
+ }
+ rcode = parse_edns_from_pkt(pq->qbuf, &pq->edns, pq->region);
if (rcode != LDNS_RCODE_NOERROR) {
error_answer(pq, rcode);
goto send_answer;
--
I'm not entirely sure you are real.