net/tcp: Search conn list again to aovid the race condition in tcp_timer_expiry
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
fe85e9d0fa
commit
9d4c708913
|
@ -138,11 +138,20 @@ static int tcp_get_timeout(FAR struct tcp_conn_s *conn)
|
|||
|
||||
static void tcp_timer_expiry(FAR void *arg)
|
||||
{
|
||||
FAR struct tcp_conn_s *conn = arg;
|
||||
FAR struct tcp_conn_s *conn = NULL;
|
||||
|
||||
net_lock();
|
||||
|
||||
while ((conn = tcp_nextconn(conn)) != NULL)
|
||||
{
|
||||
if (conn == arg)
|
||||
{
|
||||
conn->timeout = true;
|
||||
netdev_txnotify_dev(conn->dev);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
net_unlock();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue