]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1802. [bug] Handle connection resets better. [RT #11280]
authorMark Andrews <marka@isc.org>
Tue, 15 Mar 2005 01:41:28 +0000 (01:41 +0000)
committerMark Andrews <marka@isc.org>
Tue, 15 Mar 2005 01:41:28 +0000 (01:41 +0000)
CHANGES
lib/dns/resolver.c
lib/isc/unix/socket.c

diff --git a/CHANGES b/CHANGES
index a31feab48431571aab5880e29316bcafe09c95bd..f803a20d88d76df1ce8c793acab358a5f2cf6cdb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -60,7 +60,7 @@
 
 1803.  [placeholder]   rt13483
 
-1802.  [placeholder]   rt11280
+1802.  [bug]           Handle connection resets better. [RT #11280]
 
 1801.  [func]          Report differences between hints and real NS rrset
                        and associated address records.
index 5eaba1668b71fdabbbfb7f38da1f9904cff1bc51..eacbf94716f8e9b2d14be66733327c57bb85ceab 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.304 2005/03/04 03:53:21 marka Exp $ */
+/* $Id: resolver.c,v 1.305 2005/03/15 01:41:28 marka Exp $ */
 
 #include <config.h>
 
@@ -1427,6 +1427,7 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
                case ISC_R_CONNREFUSED:
                case ISC_R_NOPERM:
                case ISC_R_ADDRNOTAVAIL:
+               case ISC_R_CONNECTIONRESET:
                        /*
                         * No route to remote.
                         */
index c0f045c45ecfb488f8ede1a39d49540fa6d2ac48..6f8eb5f08bca3566fdde9f61d99996890b14830c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket.c,v 1.245 2005/02/24 00:33:34 marka Exp $ */
+/* $Id: socket.c,v 1.246 2005/03/15 01:41:28 marka Exp $ */
 
 #include <config.h>
 
@@ -284,7 +284,7 @@ socket_log(isc_socket_t *sock, isc_sockaddr_t *address,
           const char *fmt, ...)
 {
        char msgbuf[2048];
-       char peerbuf[256];
+       char peerbuf[ISC_SOCKADDR_FORMATSIZE];
        va_list ap;
 
        if (! isc_log_wouldlog(isc_lctx, level))
@@ -3294,6 +3294,7 @@ isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr,
                        ERROR_MATCH(ENOBUFS, ISC_R_NORESOURCES);
                        ERROR_MATCH(EPERM, ISC_R_HOSTUNREACH);
                        ERROR_MATCH(EPIPE, ISC_R_NOTCONNECTED);
+                       ERROR_MATCH(ECONNRESET, ISC_R_CONNECTIONRESET);
 #undef ERROR_MATCH
                }
 
@@ -3363,6 +3364,7 @@ internal_connect(isc_task_t *me, isc_event_t *ev) {
        int cc;
        ISC_SOCKADDR_LEN_T optlen;
        char strbuf[ISC_STRERRORSIZE];
+       char peerbuf[ISC_SOCKADDR_FORMATSIZE];
 
        UNUSED(me);
        INSIST(ev->ev_type == ISC_SOCKEVENT_INTW);
@@ -3439,13 +3441,16 @@ internal_connect(isc_task_t *me, isc_event_t *ev) {
                        ERROR_MATCH(EPERM, ISC_R_HOSTUNREACH);
                        ERROR_MATCH(EPIPE, ISC_R_NOTCONNECTED);
                        ERROR_MATCH(ETIMEDOUT, ISC_R_TIMEDOUT);
+                       ERROR_MATCH(ECONNRESET, ISC_R_CONNECTIONRESET);
 #undef ERROR_MATCH
                default:
                        dev->result = ISC_R_UNEXPECTED;
+                       isc_sockaddr_format(&sock->address, peerbuf,
+                                           sizeof(peerbuf));
                        isc__strerror(errno, strbuf, sizeof(strbuf));
                        UNEXPECTED_ERROR(__FILE__, __LINE__,
-                                        "internal_connect: connect() %s",
-                                        strbuf);
+                                        "internal_connect: connect(%s) %s",
+                                        peerbuf, strbuf);
                }
        } else {
                dev->result = ISC_R_SUCCESS;