Skip to content

Commit

Permalink
icmp:add net_lock to protect icmp connection
Browse files Browse the repository at this point in the history
Signed-off-by: wangchen <[email protected]>
  • Loading branch information
wangchen61698 authored and acassis committed Aug 20, 2024
1 parent 146767a commit 34fa02a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/icmp/icmp_sockif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand All @@ -280,6 +281,7 @@ static int icmp_close(FAR struct socket *psock)
conn->crefs--;
}

net_unlock();
return OK;
}

Expand Down

0 comments on commit 34fa02a

Please sign in to comment.