mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-02 12:52:10 +00:00
fixed bug #47448 (netconn/socket leak if RST is received during close)
This commit is contained in:
parent
93ccba9bcb
commit
149bb36805
@ -302,6 +302,9 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2013-03-17: Simon Goldschmidt
|
||||||
|
* api_msg.c: fixed bug #47448 (netconn/socket leak if RST is received during close)
|
||||||
|
|
||||||
2013-03-17: Joel Cunningham
|
2013-03-17: Joel Cunningham
|
||||||
* api_msg.c: don't fail closing a socket/netconn when failing to allocate the
|
* api_msg.c: don't fail closing a socket/netconn when failing to allocate the
|
||||||
FIN segment; blocking the calling thread for a while is better than risking
|
FIN segment; blocking the calling thread for a while is better than risking
|
||||||
|
@ -378,13 +378,19 @@ err_tcp(void *arg, err_t err)
|
|||||||
|
|
||||||
conn->pcb.tcp = NULL;
|
conn->pcb.tcp = NULL;
|
||||||
|
|
||||||
/* no check since this is always fatal! */
|
|
||||||
SYS_ARCH_SET(conn->last_err, err);
|
|
||||||
|
|
||||||
/* reset conn->state now before waking up other threads */
|
/* reset conn->state now before waking up other threads */
|
||||||
old_state = conn->state;
|
old_state = conn->state;
|
||||||
conn->state = NETCONN_NONE;
|
conn->state = NETCONN_NONE;
|
||||||
|
|
||||||
|
if (old_state == NETCONN_CLOSE) {
|
||||||
|
/* RST during close: let close return success & dealloc the netconn */
|
||||||
|
err = ERR_OK;
|
||||||
|
NETCONN_SET_SAFE_ERR(conn, ERR_OK);
|
||||||
|
} else {
|
||||||
|
/* no check since this is always fatal! */
|
||||||
|
SYS_ARCH_SET(conn->last_err, err);
|
||||||
|
}
|
||||||
|
|
||||||
/* @todo: the type of NETCONN_EVT created should depend on 'old_state' */
|
/* @todo: the type of NETCONN_EVT created should depend on 'old_state' */
|
||||||
|
|
||||||
/* Notify the user layer about a connection error. Used to signal select. */
|
/* Notify the user layer about a connection error. Used to signal select. */
|
||||||
|
Loading…
Reference in New Issue
Block a user