From a3bc6cd666fc91b06d32713737475f8265b1a549 Mon Sep 17 00:00:00 2001 From: jifl Date: Fri, 9 May 2008 12:14:23 +0000 Subject: [PATCH] * err.h, err.c, sockets.c: Fix bug #23119: Reorder timeout error code to stop it being treated as a fatal error. --- CHANGELOG | 4 ++++ src/api/err.c | 22 +++++++++++----------- src/api/sockets.c | 22 +++++++++++----------- src/include/lwip/err.h | 23 +++++++++++------------ 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7382d78a..effd6ef7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -22,6 +22,10 @@ HISTORY ++ Bugfixes: + 2008-05-09 Jonathan Larmour + * err.h, err.c, sockets.c: Fix bug #23119: Reorder timeout error code to + stop it being treated as a fatal error. + 2008-04-15 Simon Goldschmidt * dhcp.c: fixed bug #22804: dhcp_stop doesn't clear NETIF_FLAG_DHCP (flag now cleared) diff --git a/src/api/err.c b/src/api/err.c index a803a729..a90cb98c 100644 --- a/src/api/err.c +++ b/src/api/err.c @@ -44,17 +44,17 @@ static const char *err_strerr[] = { "Ok.", /* ERR_OK 0 */ "Out of memory error.", /* ERR_MEM -1 */ "Buffer error.", /* ERR_BUF -2 */ - "Routing problem.", /* ERR_RTE -3 */ - "Connection aborted.", /* ERR_ABRT -4 */ - "Connection reset.", /* ERR_RST -5 */ - "Connection closed.", /* ERR_CLSD -6 */ - "Not connected.", /* ERR_CONN -7 */ - "Illegal value.", /* ERR_VAL -8 */ - "Illegal argument.", /* ERR_ARG -9 */ - "Address in use.", /* ERR_USE -10 */ - "Low-level netif error.", /* ERR_IF -11 */ - "Already connected.", /* ERR_ISCONN -12 */ - "Timeout.", /* ERR_TIMEOUT -13 */ + "Timeout.", /* ERR_TIMEOUT -3 */ + "Routing problem.", /* ERR_RTE -4 */ + "Connection aborted.", /* ERR_ABRT -5 */ + "Connection reset.", /* ERR_RST -6 */ + "Connection closed.", /* ERR_CLSD -7 */ + "Not connected.", /* ERR_CONN -8 */ + "Illegal value.", /* ERR_VAL -9 */ + "Illegal argument.", /* ERR_ARG -10 */ + "Address in use.", /* ERR_USE -11 */ + "Low-level netif error.", /* ERR_IF -12 */ + "Already connected.", /* ERR_ISCONN -13 */ "Operation in progress." /* ERR_INPROGRESS -14 */ }; diff --git a/src/api/sockets.c b/src/api/sockets.c index 88fec436..323287bd 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -128,17 +128,17 @@ static const int err_to_errno_table[] = { 0, /* ERR_OK 0 No error, everything OK. */ ENOMEM, /* ERR_MEM -1 Out of memory error. */ ENOBUFS, /* ERR_BUF -2 Buffer error. */ - EHOSTUNREACH, /* ERR_RTE -3 Routing problem. */ - ECONNABORTED, /* ERR_ABRT -4 Connection aborted. */ - ECONNRESET, /* ERR_RST -5 Connection reset. */ - ESHUTDOWN, /* ERR_CLSD -6 Connection closed. */ - ENOTCONN, /* ERR_CONN -7 Not connected. */ - EINVAL, /* ERR_VAL -8 Illegal value. */ - EIO, /* ERR_ARG -9 Illegal argument. */ - EADDRINUSE, /* ERR_USE -10 Address in use. */ - -1, /* ERR_IF -11 Low-level netif error */ - -1, /* ERR_ISCONN -12 Already connected. */ - ETIMEDOUT, /* ERR_TIMEOUT -13 Timeout */ + ETIMEDOUT, /* ERR_TIMEOUT -3 Timeout */ + EHOSTUNREACH, /* ERR_RTE -4 Routing problem. */ + ECONNABORTED, /* ERR_ABRT -5 Connection aborted. */ + ECONNRESET, /* ERR_RST -6 Connection reset. */ + ESHUTDOWN, /* ERR_CLSD -7 Connection closed. */ + ENOTCONN, /* ERR_CONN -8 Not connected. */ + EINVAL, /* ERR_VAL -9 Illegal value. */ + EIO, /* ERR_ARG -10 Illegal argument. */ + EADDRINUSE, /* ERR_USE -11 Address in use. */ + -1, /* ERR_IF -12 Low-level netif error */ + -1, /* ERR_ISCONN -13 Already connected. */ EINPROGRESS /* ERR_INPROGRESS -14 Operation in progress */ }; diff --git a/src/include/lwip/err.h b/src/include/lwip/err.h index e5063235..1d6383e7 100644 --- a/src/include/lwip/err.h +++ b/src/include/lwip/err.h @@ -45,25 +45,24 @@ typedef s8_t err_t; #define ERR_OK 0 /* No error, everything OK. */ #define ERR_MEM -1 /* Out of memory error. */ #define ERR_BUF -2 /* Buffer error. */ -#define ERR_RTE -3 /* Routing problem. */ +#define ERR_TIMEOUT -3 /* Timeout. */ +#define ERR_RTE -4 /* Routing problem. */ #define ERR_IS_FATAL(e) ((e) < ERR_RTE) -#define ERR_ABRT -4 /* Connection aborted. */ -#define ERR_RST -5 /* Connection reset. */ -#define ERR_CLSD -6 /* Connection closed. */ -#define ERR_CONN -7 /* Not connected. */ +#define ERR_ABRT -5 /* Connection aborted. */ +#define ERR_RST -6 /* Connection reset. */ +#define ERR_CLSD -7 /* Connection closed. */ +#define ERR_CONN -8 /* Not connected. */ -#define ERR_VAL -8 /* Illegal value. */ +#define ERR_VAL -9 /* Illegal value. */ -#define ERR_ARG -9 /* Illegal argument. */ +#define ERR_ARG -10 /* Illegal argument. */ -#define ERR_USE -10 /* Address in use. */ +#define ERR_USE -11 /* Address in use. */ -#define ERR_IF -11 /* Low-level netif error */ -#define ERR_ISCONN -12 /* Already connected. */ - -#define ERR_TIMEOUT -13 /* Timeout. */ +#define ERR_IF -12 /* Low-level netif error */ +#define ERR_ISCONN -13 /* Already connected. */ #define ERR_INPROGRESS -14 /* Operation in progress */