icmp:add net_lock to protect icmp connection

Signed-off-by: wangchen <wangchen41@xiaomi.com>
This commit is contained in:
wangchen 2024-07-22 16:05:37 +08:00 committed by Alan Carvalho de Assis
parent 146767a8a2
commit 34fa02a652

View File

@ -254,6 +254,7 @@ static int icmp_close(FAR struct socket *psock)
{
FAR struct icmp_conn_s *conn;
net_lock();
conn = psock->s_conn;
/* Is this the last reference to the connection structure (there could be\
@ -280,6 +281,7 @@ static int icmp_close(FAR struct socket *psock)
conn->crefs--;
}
net_unlock();
return OK;
}