From 382a5ec4524028e2e5753de9185e7a60723250bc Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Sun, 22 May 2016 18:23:15 +0200 Subject: [PATCH] getdns_query daemon pass through header options (Enables DNSSEC for stub mode, but not for recursive) --- src/test/getdns_query.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/test/getdns_query.c b/src/test/getdns_query.c index 634317ac..3f05a7ec 100644 --- a/src/test/getdns_query.c +++ b/src/test/getdns_query.c @@ -2319,6 +2319,36 @@ getdns_return_t schedule_request(dns_msg *msg) char *qname_str = NULL; uint32_t qtype; getdns_return_t r; + getdns_dict *header; + uint32_t n; + getdns_list *list; + + /* pass through the header and the OPT record */ + if (!getdns_dict_get_dict(msg->query, "header", &header)) + (void)getdns_dict_set_dict(extensions, "header", header); + + if (!getdns_dict_get_int(msg->query, "/additional/0/do", &n)) + (void)getdns_dict_set_int( + extensions, "/add_opt_parameters/do_bit", n); + + if (!getdns_dict_get_int(msg->query,"/additional/0/extended_rcode",&n)) + (void)getdns_dict_set_int( + extensions, "/add_opt_parameters/extended_rcode", n); + + if (!getdns_dict_get_int(msg->query, "/additional/0/version", &n)) + (void)getdns_dict_set_int( + extensions, "/add_opt_parameters/version", n); + + if (!getdns_dict_get_int( + msg->query, "/additional/0/udp_payload_size", &n)) + (void)getdns_dict_set_int(extensions, + "/add_opt_parameters/maximum_udp_payload_size", n); + + if (!getdns_dict_get_list( + msg->query, "/additional/0/rdata/options", &list)) + (void)getdns_dict_set_list(extensions, + "/add_opt_parameters/options", list); + if ((r = getdns_dict_get_bindata(msg->query,"/question/qname",&qname))) fprintf(stderr, "Could not get qname from query: %s\n",