From a86e21da25b31918dbbaf21abf8ef41d7107af8a Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 1 Mar 2022 18:30:23 +0000 Subject: [PATCH] Upstream renamed parse_extract_edns to parse_extract_edns_from_response_msg and parse_edns_from_pkt to parse_edns_from_query_pkt in libunbound 1.14.0. 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. testing & OK sthen --- sbin/unwind/frontend.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sbin/unwind/frontend.c b/sbin/unwind/frontend.c index 1b6333da22c..e267b923800 100644 --- a/sbin/unwind/frontend.c +++ b/sbin/unwind/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.69 2021/11/16 16:45:23 kn Exp $ */ +/* $OpenBSD: frontend.c,v 1.70 2022/03/01 18:30:23 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser @@ -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; -- 2.20.1