buglwIP - A Lightweight TCP/IP stack - Bugs: bug #51687, tcp_close(): is it OK to return...

 
 

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

bug #51687: tcp_close(): is it OK to return ERR_MEM if TF_CLOSEPEND is set?

Submitted by:  Simon Goldschmidt <goldsimon>
Submitted on:  Tue 08 Aug 2017 11:50:42 AM UTC  
 
Category:  TCP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  Simon Goldschmidt <goldsimon>
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Mon 28 Aug 2017 08:00:18 PM UTC, comment #2:

Fixed by returning ERR_OK instead of ERR_MEM if TF_CLOSEPEND is set:
This is OK here since sending FIN does not guarantee a time frame for actually freeing the pcb, either (it is left in closure states for remote ACK or timeout)

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 25 Aug 2017 08:51:03 PM UTC, comment #1:

> is it OK to return ERR_MEM if TF_CLOSEPEND is set?


Actually, it's not. Up to and including 2.0.1, tcp_close() returning != ERR_OK means the pcb is not gone. Applications like the httpd retry closing in their 'poll' function and are not prepared for the pcb to vanish by tcp_tmr() closing it.

This is a change I have introduced after 2.0.1, so it's OK to change it again.

We can either make tcp_close() return ERR_OK in this case (should be OK since the pcb is not freed anyway from tcp_close(), normally) or let the user app call another function to achieve dalayed closing.
Something like:

or

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 08 Aug 2017 11:50:42 AM UTC, original submission:
Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.

 

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 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-28 goldsimon CategoryNone => TCP
        Item GroupNone => Faulty Behaviour
        StatusNone => Fixed
        Assigned toNone => goldsimon
        Open/ClosedOpen => Closed

    Back to the top


    Powered by Savane 3.3