lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Bug in tcp_listen(): Multiple listen on same socket


From: Vlahovic, Donald
Subject: [lwip-users] Bug in tcp_listen(): Multiple listen on same socket
Date: Fri, 4 Apr 2003 14:42:24 +0200

Hi !

If you do listen on same socket multiple times every listen command creates
another struct tcp_pcb_listen and registers this struct in tcp_listen_pcbs
list. So the same PCB is registered multiple times in this list.

To fix this query PCB state and if state is LISTEN return passed PCB.

struct tcp_pcb *
tcp_listen(struct tcp_pcb *pcb)
{
  struct tcp_pcb_listen *lpcb;

   /* Bugfix: No second listen on same socket */
   if(pcb->state == LISTEN)
      return pcb;
      ...

Bye !

Donald Vlahovic





reply via email to

[Prev in Thread] Current Thread [Next in Thread]