Merge branch '1059-prevent-query-loops-for-misbehaving-servers-v9_11' into 'v9_11'
[v9_11] Prevent query loops for misbehaving servers See merge request isc-projects/bind9!2509
This commit is contained in:
@@ -230,6 +230,17 @@ resolution_succeeds edns512-notcp. || ret=1
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
n=`expr $n + 1`
|
||||
echo_i "checking recursive lookup to edns 512 + no tcp server does not cause query loops ($n)"
|
||||
ret=0
|
||||
sent=`grep -c -F "sending packet to 10.53.0.7" ns1/named.run`
|
||||
if [ $sent -ge 10 ]; then
|
||||
echo_i "ns1 sent $sent queries to ns7, expected less than 10"
|
||||
ret=1
|
||||
fi
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
if $SHELL ../testcrypto.sh > /dev/null 2>&1
|
||||
then
|
||||
$PERL $SYSTEMTESTTOP/stop.pl --use-rndc --port ${CONTROLPORT} legacy ns1
|
||||
|
||||
@@ -2734,6 +2734,19 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
|
||||
* No route to remote.
|
||||
*/
|
||||
isc_socket_detach(&query->tcpsocket);
|
||||
/*
|
||||
* Do not query this server again in this fetch context
|
||||
* if we already tried reducing the advertised EDNS UDP
|
||||
* payload size to 512 bytes and the server is
|
||||
* unavailable over TCP. This prevents query loops
|
||||
* lasting until the fetch context restart limit is
|
||||
* reached when attempting to get answers whose size
|
||||
* exceeds 512 bytes from broken servers.
|
||||
*/
|
||||
if ((query->options & DNS_FETCHOPT_EDNS512) != 0) {
|
||||
add_bad(fctx, query->addrinfo, sevent->result,
|
||||
badns_unreachable);
|
||||
}
|
||||
fctx_cancelquery(&query, NULL, NULL, true, false);
|
||||
retry = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user