lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #20315] Problem in the use of tcp_listen in api_msg.c


From: Frédéric Bernon
Subject: [lwip-devel] [bug #20315] Problem in the use of tcp_listen in api_msg.c
Date: Tue, 03 Jul 2007 21:49:00 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

URL:
  <http://savannah.nongnu.org/bugs/?20315>

                 Summary: Problem in the use of tcp_listen in api_msg.c
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: fbernon
            Submitted on: lundi 02.07.2007 à 10:12
                Category: TCP
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: fbernon
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

In do_listen (in api_msg.c file), the tcp_listen call is :

msg->conn->pcb.tcp = tcp_listen(msg->conn->pcb.tcp);

The problem is that, if tcp_listen can't alloc a tcp_pcb_listen
(memp_malloc(MEMP_TCP_PCB_LISTEN) return NULL), the pcb.tcp used to listen is
lost (since the msg->conn->pcb.tcp is directly set, without any error
checking).

I suppose that perhaps, a processing in a TCP timer will free the pcb.tcp,
but I think it should be directly delete in tcp_listen, like this:

  lpcb = memp_malloc(MEMP_TCP_PCB_LISTEN);
  if (lpcb == NULL) {
    tcp_pcb_remove(&tcp_active_pcbs, pcb);
    memp_free(MEMP_TCP_PCB, pcb);
    return NULL;
  }

Can I have your comments about that?






    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?20315>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

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