buglwIP - A Lightweight TCP/IP stack - Bugs: bug #55536, lwIP 2.1.2: netconn_delete()...

 
 

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

bug #55536: lwIP 2.1.2: netconn_delete() called twice from lwip_accept()

Submitter:  Stanislav Pobořil <spoboril>
Submitted:  Mon 21 Jan 2019 11:56:28 AM UTC
   
 
Category:  sockets/netconn Severity:  3 - Normal
Item Group:  Crash Error Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  Other

Fri 15 Feb 2019 02:35:07 AM UTC, comment #2: 

Hi Dirk,
This bug report is for 2.1.2.
So I think this should apply to 2.1.x branch before mark the bug report as fixed.

Axel Lin <axellin>
Group Member
Mon 28 Jan 2019 01:14:19 PM UTC, comment #1: 

Fixed, thanks for reporting

Dirk Ziegelmeier <dziegel>
Group administrator
Mon 21 Jan 2019 11:56:28 AM UTC, original submission:  

Below is a code snippet from lwip_accept().
If netconn_peer() fails, lwIP ends hanged in a "netconn state error" assert. I think the reason is that netconn_delete() is called twice, once directly and then also from free_socket().
Removing the netconn_delete() call done before the free_socket() call seems to solve the problem for me.

    err = netconn_peer(newconn, &naddr, &port);
    if (err != ERR_OK) {
      LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d): netconn_peer failed, err=%d\n", s, err));
      netconn_delete(newconn);
      free_socket(nsock, 1);
      sock_set_errno(sock, err_to_errno(err));
      done_socket(sock);
      return -1;
    }

Stanislav Pobořil <spoboril>

 

(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 axellin (Posted a comment)
  • -email is unavailable- added by dziegel (Posted a comment)
  • -email is unavailable- added by spoboril (Submitted the item)
  • -email is unavailable- added by spoboril
  •  

    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
    2019-01-28 dziegel StatusNone Fixed
        Open/ClosedOpen Closed
    2019-01-21 spoboril Carbon-Copy- Added spoboril

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code