Skip to content

Commit 0bc8a0d

Browse files
jukkarnashif
authored andcommitted
net: dns: Fix next answer position when parsing packet
As the answer might not be compressed, calculate next answer position correctly. Signed-off-by: Jukka Rissanen <[email protected]> Signed-off-by: Flavio Ceolin <[email protected]>
1 parent fd8ed64 commit 0bc8a0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/net/lib/dns/resolve.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,8 @@ static int dns_read(struct dns_resolve_context *ctx,
463463
}
464464

465465
/* Update the answer offset to point to the next RR (answer) */
466-
dns_msg.answer_offset += DNS_ANSWER_PTR_LEN;
466+
dns_msg.answer_offset += dns_msg.response_position -
467+
dns_msg.answer_offset;
467468
dns_msg.answer_offset += dns_msg.response_length;
468469

469470
server_idx++;

0 commit comments

Comments
 (0)