lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #29345] Compiler error: _tcp_accepted(), _tcp_recved()


From: Petr Cernin
Subject: [lwip-devel] [bug #29345] Compiler error: _tcp_accepted(), _tcp_recved() referenced even LWIP_TCP is 0
Date: Fri, 26 Mar 2010 10:08:53 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729)

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

                 Summary: Compiler error: _tcp_accepted(), _tcp_recved()
referenced even LWIP_TCP is 0
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: cerninp
            Submitted on: Fri 26 Mar 2010 10:08:53 AM GMT
                Category: TCP
                Severity: 3 - Normal
              Item Group: Compiler Warning
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: CVS Head

    _______________________________________________________

Details:

_tcp_accepted() and _tcp_recved() are referenced in netcon_drain() (in
api_msg.c) even LWIP_TCP in lwipopts.h is set to 0.

There are missing #if #endif::


void
netconn_drain(struct netconn *conn)
{
  void *mem;
  struct pbuf *p;

  /* This runs in tcpip_thread, so we don't need to lock against rx packets
*/

  /* Delete and drain the recvmbox. */
  if (sys_mbox_valid(&conn->recvmbox)) {
    while (sys_mbox_tryfetch(&conn->recvmbox, &mem) != SYS_MBOX_EMPTY) {
>>>>>#if LWIP_TCP
      if (conn->type == NETCONN_TCP) {
        if(mem != NULL) {
          p = (struct pbuf*)mem;
          /* pcb might be set to NULL already by err_tcp() */
          if (conn->pcb.tcp != NULL) {
            tcp_recved(conn->pcb.tcp, p->tot_len);
          }
          pbuf_free(p);
        }
      } else {
        netbuf_delete((struct netbuf *)mem);
      }
>>>>>#else /* LWIP_TCP */
      netbuf_delete((struct netbuf *)mem);
>>>>>#endif /* LWIP_TCP */
    }
    sys_mbox_free(&conn->recvmbox);
    sys_mbox_set_invalid(&conn->recvmbox);
  }

  /* Delete and drain the acceptmbox. */
  if (sys_mbox_valid(&conn->acceptmbox)) {
    while (sys_mbox_tryfetch(&conn->acceptmbox, &mem) != SYS_MBOX_EMPTY) {
      /* Only tcp pcbs have an acceptmbox, so no need to check conn->type */
      /* pcb might be set to NULL already by err_tcp() */
>>>>>#if LWIP_TCP
      if (conn->pcb.tcp != NULL) {
        tcp_accepted(conn->pcb.tcp);
      }
>>>>>#endif /* LWIP_TCP */
      netconn_delete((struct netconn *)mem);
    }

    sys_mbox_free(&conn->acceptmbox);
    sys_mbox_set_invalid(&conn->acceptmbox);
  }
}




    _______________________________________________________

Reply to this item at:

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

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





reply via email to

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