Skip to content

Commit

Permalink
fix: parse dns answers has problem about cname
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 79f55a5 commit ed8a3eb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/dns_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ process_dns_response(unsigned char *response, int response_len) {

// Parse the answer section
for (int i = 0; i < ancount; i++) {
char answer_name[MAX_DNS_NAME] = {0};
parse_name(response, &ptr, answer_name);
debug(LOG_DEBUG, "Answer name: %s", answer_name);

// get the type and data length
unsigned short type = ntohs(*(unsigned short *)ptr);
ptr += 8; // Skip class, TTL, and data length
unsigned short data_len = ntohs(*(unsigned short *)ptr);
Expand Down

0 comments on commit ed8a3eb

Please sign in to comment.