lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #27955] netconn_close may nether return when LWIP_TCPI


From: Dmirti Snejko
Subject: [lwip-devel] [bug #27955] netconn_close may nether return when LWIP_TCPIP_CORE_LOCKING enabled
Date: Fri, 06 Nov 2009 02:10:21 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4 (.NET CLR 3.5.30729)

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

                 Summary: netconn_close may nether return when
LWIP_TCPIP_CORE_LOCKING enabled 
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: dsnejko
            Submitted on: Fri 06 Nov 2009 02:10:19 AM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: 1.3.1

    _______________________________________________________

Details:

When received RST from a remote side TCPIP core sets netconn->err to ERR_RST 
and netconn->pcb.tcp to NULL.
Closing the connection with netconn_close(netconn) finally makes the core to
call do_close callback:
void
do_close(struct api_msg_msg *msg)
{
#if LWIP_TCP
 if ((msg->conn->pcb.tcp != NULL) && (msg->conn->type == NETCONN_TCP)) {
     msg->conn->state = NETCONN_CLOSE;
     do_close_internal(msg->conn);
     /* for tcp netconns, do_close_internal ACKs the message */
 } else
#endif /* LWIP_TCP */
 {
   msg->conn->err = ERR_VAL;
   TCPIP_APIMSG_ACK(msg);         // <- the bug
 }
}

which in this case supposed to call macro TCPIP_APIMSG_ACK(msg) to release
the application layer. With LWIP_TCPIP_CORE_LOCKING enabled macro
TCPIP_APIMSG_ACK(msg) is defined empty. As result the application layer blocks
on waiting  conn->op_completed semaphore, netconn_close nether returns.

Instead calling TCPIP_APIMSG_ACK(msg) it should be replaced with :
  if (msg->conn->op_completed != SYS_SEM_NULL) {
    sys_sem_signal(msg->conn->op_completed); 

as do_delconn(struct api_msg_msg *msg) does.





    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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