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: TCPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned 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
  • -unavailable- added by goldsimon (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 28 Aug 2017 08:00:18 PM UTCgoldsimonCategoryNone=>TCP
      Item GroupNone=>Faulty Behaviour
      StatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1