Skip to content

Commit

Permalink
debug: add some debug info to dns parse
Browse files Browse the repository at this point in the history
Signed-off-by: Dengfeng Liu <[email protected]>
  • Loading branch information
liudf0716 committed Jun 12, 2024
1 parent f18f7e8 commit b0a0bf2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dns_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ process_dns_response(char *response, int response_len)
}

int msg_count = ns_msg_count(handle, ns_s_an);
debug(LOG_DEBUG, "DNS response contains %d answers", msg_count);
for (int i = 0; i < msg_count; i++) {
ns_rr rr;
if (ns_parserr(&handle, ns_s_an, i, &rr) < 0) {
debug(LOG_WARNING, "ns_parserr: %s", strerror(errno));
continue;
}

debug(LOG_DEBUG, "DNS response type: %d", ns_rr_type(rr));

if (ns_rr_type(rr) == ns_t_a) {
t_domain_trusted *p = NULL;
char domain[NS_MAXDNAME] = {0};
Expand Down

0 comments on commit b0a0bf2

Please sign in to comment.