]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] Preserve req->pos during reply validation to prevent packet truncation on retra...
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 10 Nov 2025 09:21:36 +0000 (09:21 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 10 Nov 2025 09:21:36 +0000 (09:21 +0000)
commit1833877202e35b65600efcf159732f8bdeaefce9
tree4cc7578c77a21b3741110ac181be4eb4333250a6
parentd2f29a73f9f5188d6d32a120e207b59ec76d45ec
[Fix] Preserve req->pos during reply validation to prevent packet truncation on retransmit

The rdns_request_reply_cmp function modifies req->pos as a side effect
during reply validation. This caused packet truncation on retransmits
because req->pos (which tracks the full packet length) was overwritten
with the end position of the question section.

On timeout/retry, rdns_send_request would use the corrupted req->pos
value, resulting in truncated packets missing the OPT additional section.
This made resolvers like Knot and PowerDNS unable to parse retransmitted
packets.

Fix by saving and restoring req->pos around the reply comparison logic.
contrib/librdns/resolver.c