buglwIP - A Lightweight TCP/IP stack - Bugs: bug #29345, Compiler error: _tcp_accepted(),...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #29345: Compiler error: _tcp_accepted(), _tcp_recved() referenced even LWIP_TCP is 0

Submitter:  Petr Cernin <cerninp>
Submitted:  Fri 26 Mar 2010 10:08:53 AM UTC
   
 
Category:  TCP Severity:  3 - Normal
Item Group:  Compiler Warning Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Fri 26 Mar 2010 04:10:44 PM UTC, comment #2: 

Fixed, thanks for reporting.

Simon Goldschmidt <goldsimon>
Group administrator
Fri 26 Mar 2010 10:13:04 AM UTC, comment #1: 

please change the word 'even' to 'when'.

Petr Cernin <cerninp>
Fri 26 Mar 2010 10:08:53 AM UTC, original submission:  

_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);
  }
}

Petr Cernin <cerninp>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by cerninp (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-03-26 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code