patchlwIP - A Lightweight TCP/IP stack - Patches: patch #10260, Set SO_LINGER and close socket...

 
 

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

patch #10260: Set SO_LINGER and close socket will trigger LWIP_ASSERT

Submitter:  yuanjianmin <yuanjm>
Submitted:  Tue 28 Jun 2022 10:10:09 AM UTC
   
 
Category:  TCP Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Planned Release:  None

Tue 28 Jun 2022 10:10:09 AM UTC, original submission:  

When i create a TCP server socket and set SO_LINGER. Then i call listen function to hear connection from peer. After that i call close to close this socket and then LWIP_ASSERT appear.

I search the code and found it in http://git.savannah.gnu.org/cgit/lwip.git/tree/src/core/tcp.c#n576. That means lwip not allowed that tcp_abort called when tcp in LISTEN state.

Of course, i agree with the LWIP_ASSERT, but i think we can modify the LWIP code to avoid to call tcp_abort. We can call tcp_close when SO_LINGER set and TCP state is in LISTEN.

The attachment is my patch to avoid this assert. Glad to hear your voice.

yuanjianmin <yuanjm>

 

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

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by yuanjm (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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-28 yuanjm Attached File- Added 0001-Fix-close-listen-TCP-which-set-SO_LINGER-will-trigge.patch, #53380

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code