Mailing List Archive

[Bug 8225] askdns TCP fallback not working with UDP truncated TXT response
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8225

Sidney Markowitz <sidney@sidney.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #5940|0 |1
is obsolete| |
CC| |sidney@sidney.com

--- Comment #1 from Sidney Markowitz <sidney@sidney.com> ---
Created attachment 5941
--> https://bz.apache.org/SpamAssassin/attachment.cgi?id=5941&action=edit
patch to support TCP fallback by using Net::DNS::Resolver

I decided that it is not reasonable to try to support TCP fallback in our
DnsResolver, because unlike Net::DNS::Resolver we have no code for DNS queries
using TCP, and we have quite a bit of code to support reuse of sockets for
efficiency with the large number of queries that SpamAssassin generates, with
everything written for UDP. I would not want to have to go through figuring out
where code has to be duplicated and rewritten to add TCP support.

However, I have written a small patch that when a truncated reply comes back
because of a large UDP response, it resends and reads the query using
Net::DNS::Resolver bgsend and bgread, then continues from there.

It turned out to be the same code to make it work with our DnsResolver that it
would have been to make it work only with askdns, so I implemented the more
general solution.

The attached patch reverts the change to SPF.pm from bug 8213 as no longer
necessary. The patch also contains the new test case in t/askdns.t that checks
for this. Again, note that I have to be using 1.1.1.1 as the nameserver to
reliably reproduce the bug.

This is a fairly conservative patch because it should only do anything
different when a truncated packet is seen, a situation would never succeed
anyway without this patch. This is a fundamental enough change I would
appreciate some eyes on it before I commit it.

I tested with Net::DNS versions 1.10, 1.29, 1.38, 1.40 and the current release,
1.44.

--
You are receiving this mail because:
You are the assignee for the bug.