diff options
Diffstat (limited to 'source4/dns_server/dns_query.c')
-rw-r--r-- | source4/dns_server/dns_query.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/dns_server/dns_query.c b/source4/dns_server/dns_query.c index 4ad14b9a55..5414e1d9ee 100644 --- a/source4/dns_server/dns_query.c +++ b/source4/dns_server/dns_query.c @@ -138,14 +138,17 @@ struct ask_forwarder_state { static void ask_forwarder_done(struct tevent_req *subreq); static struct tevent_req *ask_forwarder_send( + struct dns_server *dns, TALLOC_CTX *mem_ctx, struct tevent_context *ev, const char *forwarder, struct dns_name_question *question) { struct tevent_req *req, *subreq; struct ask_forwarder_state *state; + struct dns_res_rec *options; struct dns_name_packet out_packet = { 0, }; DATA_BLOB out_blob; enum ndr_err_code ndr_err; + WERROR werr; req = tevent_req_create(mem_ctx, &state, struct ask_forwarder_state); if (req == NULL) { @@ -166,6 +169,15 @@ static struct tevent_req *ask_forwarder_send( out_packet.qdcount = 1; out_packet.questions = question; + werr = dns_generate_options(dns, state, &options); + if (!W_ERROR_IS_OK(werr)) { + tevent_req_werror(req, werr); + return tevent_req_post(req, ev); + } + + out_packet.arcount = 1; + out_packet.additional = options; + ndr_err = ndr_push_struct_blob( &out_blob, state, &out_packet, (ndr_push_flags_fn_t)ndr_push_dns_name_packet); @@ -615,6 +627,7 @@ struct tevent_req *dns_server_process_query_send( in->questions[0].name)); subreq = ask_forwarder_send( + dns, state, ev, lpcfg_dns_forwarder(dns->task->lp_ctx), &in->questions[0]); if (tevent_req_nomem(subreq, req)) { |