[v9_18] When resending a UDP request, insert the query to the lookup's list
When a query times out, and dig
(or host
) creates a new query to resend the request, it is being prepended to the lookup's queries list, which can cause a confusion later, making dig
(or host
) believe that there is another new query in the list, but that is actually the old one, which was timed out. That mistake will result in an assertion failure.
That can happen, in particular, when after a timed out request, the retried request returns a SERVFAIL result, and the recursion is enabled, and +nofail
option was used with dig
(that is the default behavior in host
, unless the -s
option is provided).
Fix the problem by inserting the query just after the current, timed-out query, instead of prepending to the list.
Closes #3020 (closed)