1114. [port] Ignore more accept() errors. [RT #2021]
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,3 +1,5 @@
|
|||||||
|
1114. [port] Ignore more accept() errors. [RT #2021]
|
||||||
|
|
||||||
1113. [bug] allow-update/allow-update-forwarding did not work
|
1113. [bug] allow-update/allow-update-forwarding did not work
|
||||||
when specified in a view. [RT #2014]
|
when specified in a view. [RT #2014]
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: socket.c,v 1.211 2001/10/31 01:24:58 gson Exp $ */
|
/* $Id: socket.c,v 1.212 2001/11/08 20:24:25 gson Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -1710,7 +1710,10 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
|
|||||||
* EAGAIN or EINTR, simply poke the watcher to watch this socket
|
* EAGAIN or EINTR, simply poke the watcher to watch this socket
|
||||||
* again. Also ignore ECONNRESET, which has been reported to
|
* again. Also ignore ECONNRESET, which has been reported to
|
||||||
* be spuriously returned on Linux 2.2.19 although it is not
|
* be spuriously returned on Linux 2.2.19 although it is not
|
||||||
* a documented error for accept().
|
* a documented error for accept(). ECONNABORTED has been
|
||||||
|
* reported for Solaris 8. The rest are thrown in not because
|
||||||
|
* we have seen them but because they are ignored by other
|
||||||
|
* deamons such as BIND 8 and Apache.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
addrlen = sizeof dev->newsocket->address.type;
|
addrlen = sizeof dev->newsocket->address.type;
|
||||||
@@ -1718,20 +1721,36 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
|
|||||||
fd = accept(sock->fd, &dev->newsocket->address.type.sa,
|
fd = accept(sock->fd, &dev->newsocket->address.type.sa,
|
||||||
(void *)&addrlen);
|
(void *)&addrlen);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
if (SOFT_ERROR(errno) || errno == ECONNRESET) {
|
if (SOFT_ERROR(errno))
|
||||||
goto soft_error;
|
goto soft_error;
|
||||||
} else {
|
switch (errno) {
|
||||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
case ECONNRESET:
|
||||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
case ECONNABORTED:
|
||||||
"internal_accept: accept() %s: %s",
|
case EHOSTUNREACH:
|
||||||
isc_msgcat_get(isc_msgcat,
|
case EHOSTDOWN:
|
||||||
ISC_MSGSET_GENERAL,
|
case ENETUNREACH:
|
||||||
ISC_MSG_FAILED,
|
case ENETDOWN:
|
||||||
"failed"),
|
case ECONNREFUSED:
|
||||||
strbuf);
|
#ifdef EPROTO
|
||||||
fd = -1;
|
case EPROTO:
|
||||||
result = ISC_R_UNEXPECTED;
|
#endif
|
||||||
|
#ifdef ENONET
|
||||||
|
case ENONET:
|
||||||
|
#endif
|
||||||
|
goto soft_error;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||||
|
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||||
|
"internal_accept: accept() %s: %s",
|
||||||
|
isc_msgcat_get(isc_msgcat,
|
||||||
|
ISC_MSGSET_GENERAL,
|
||||||
|
ISC_MSG_FAILED,
|
||||||
|
"failed"),
|
||||||
|
strbuf);
|
||||||
|
fd = -1;
|
||||||
|
result = ISC_R_UNEXPECTED;
|
||||||
} else {
|
} else {
|
||||||
if (addrlen == 0) {
|
if (addrlen == 0) {
|
||||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||||
|
|||||||
Reference in New Issue
Block a user