mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-21 23:56:59 +08:00
fixed bug #47448 (netconn/socket leak if RST is received during close)
This commit is contained in:
@@ -378,13 +378,19 @@ err_tcp(void *arg, err_t err)
|
||||
|
||||
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 */
|
||||
old_state = conn->state;
|
||||
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' */
|
||||
|
||||
/* Notify the user layer about a connection error. Used to signal select. */
|
||||
|
||||
Reference in New Issue
Block a user