--- source4/dns_server/dns_query.c.orig 2018-11-26 09:38:10.000000000 +0100 +++ source4/dns_server/dns_query.c 2019-10-05 17:20:26.000000000 +0200 @@ -370,6 +370,7 @@ static WERROR ask_forwarder_recv( struct tevent_req *req, TALLOC_CTX *mem_ctx, + uint16_t *operation, struct dns_res_rec **answers, uint16_t *ancount, struct dns_res_rec **nsrecs, uint16_t *nscount, struct dns_res_rec **additional, uint16_t *arcount) @@ -383,6 +384,8 @@ return err; } + *operation = in_packet->operation; + *ancount = in_packet->ancount; *answers = talloc_move(mem_ctx, &in_packet->answers); @@ -553,6 +556,7 @@ subreq, struct tevent_req); struct handle_dnsrpcrec_state *state = tevent_req_data( req, struct handle_dnsrpcrec_state); + uint16_t operation = 0; struct dns_res_rec *answers, *nsrecs, *additional; uint16_t ancount = 0; uint16_t nscount = 0; @@ -560,7 +564,7 @@ uint16_t i; WERROR werr; - werr = ask_forwarder_recv(subreq, state, &answers, &ancount, + werr = ask_forwarder_recv(subreq, state, &operation, &answers, &ancount, &nsrecs, &nscount, &additional, &arcount); if (tevent_req_werror(req, werr)) { return; @@ -968,6 +972,7 @@ struct dns_server *dns; struct dns_name_question *question; + uint16_t operation; struct dns_res_rec *answers; uint16_t ancount; struct dns_res_rec *nsrecs; @@ -1087,7 +1092,7 @@ req, struct dns_server_process_query_state); WERROR werr; - werr = ask_forwarder_recv(subreq, state, + werr = ask_forwarder_recv(subreq, state, &state->operation, &state->answers, &state->ancount, &state->nsrecs, &state->nscount, &state->additional, &state->arcount); @@ -1173,6 +1178,7 @@ WERROR dns_server_process_query_recv( struct tevent_req *req, TALLOC_CTX *mem_ctx, + uint16_t *operation, struct dns_res_rec **answers, uint16_t *ancount, struct dns_res_rec **nsrecs, uint16_t *nscount, struct dns_res_rec **additional, uint16_t *arcount) @@ -1188,6 +1194,7 @@ return err; } } + *operation = state->operation; *answers = talloc_move(mem_ctx, &state->answers); *ancount = state->ancount; *nsrecs = talloc_move(mem_ctx, &state->nsrecs);