From 12fc0239c270b61af48e808ed3b3153a6dff5e0d Mon Sep 17 00:00:00 2001 From: likewise Date: Sun, 6 Apr 2003 20:35:50 +0000 Subject: [PATCH] Fixed bug #3112 (faulty behaviour calling tcp_listen() when already listening) --- src/core/tcp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/tcp.c b/src/core/tcp.c index 0258f509..458c6e07 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -312,6 +312,10 @@ tcp_listen(struct tcp_pcb *pcb) { struct tcp_pcb_listen *lpcb; + /* already listening? */ + if(pcb->state == LISTEN) { + return pcb; + } lpcb = memp_malloc(MEMP_TCP_PCB_LISTEN); if(lpcb == NULL) { return NULL;