From e2754cc316ca1fadabfbd8c927275a0d0d50d867 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Tue, 30 Jan 2024 15:38:13 +0800
Subject: [PATCH] fix move lpcb to the front of list error

---
 src/core/tcp_in.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c
index ec1905f..9d5a695 100644
--- a/src/core/tcp_in.c
+++ b/src/core/tcp_in.c
@@ -454,6 +454,10 @@ tcp_input(struct pbuf *p, struct netif *inp)
         /* our successor is the remainder of the listening list */
         lpcb->next = tcp_listen_pcbs.listen_pcbs;
 #if GAZELLE_ENABLE
+        /* prev is head */
+        if (prev->prev == NULL) {
+            prev->prev = (struct tcp_pcb *)lpcb;
+        }
         lpcb->prev = NULL;
 #endif
         /* put this listening pcb at the head of the listening list */
-- 
2.33.0

