Skip to content

Commit 6dfb11c

Browse files
jukkarnashif
authored andcommitted
net: tcp2: Use safe version of slist macro in conn search
Use SYS_SLIST_FOR_EACH_CONTAINER_SAFE() macro when searching the connection list so that we notice if new entries are added or removed in the list. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 54d05ef commit 6dfb11c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/net/ip/tcp2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,8 +942,9 @@ static struct tcp *tcp_conn_search(struct net_pkt *pkt)
942942
{
943943
bool found = false;
944944
struct tcp *conn;
945+
struct tcp *tmp;
945946

946-
SYS_SLIST_FOR_EACH_CONTAINER(&tcp_conns, conn, next) {
947+
SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&tcp_conns, conn, tmp, next) {
947948

948949
found = tcp_conn_cmp(conn, pkt);
949950
if (found) {

0 commit comments

Comments
 (0)