buglwIP - A Lightweight TCP/IP stack - Bugs: bug #33962, TF_FIN not always set after FIN is...

 
 

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

bug #33962: TF_FIN not always set after FIN is sent

Submitted by:  Cameron Gutman <aicom>
Submitted on:  Sun 07 Aug 2011 05:09:39 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Mon 22 Aug 2011 04:57:55 PM UTC, comment #4:

Oh, right, sorry for messing that up. I saw it now from the mailing list, but the post here was a bit less detailed than that.

After all, I had three weeks to catch up on the list ;-)

Fixed by adding the proposed "pcb->flags |= TF_FIN;"

I regard this as a minor bug (it only influences throughput, does not corrupt anything, so no need to force a new release).

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 22 Aug 2011 12:36:40 PM UTC, comment #3:

>In tcp_send_fin(),
>pcb->unsent is checked and the last segment in this queue gets the FIN flag
>so this should work


Hi Simon,
the TCP_FIN flag is indeed set in the SEGMENT and will be set in the last output packet. The problem is not here.
The issue is that the TF_FIN flag is not set in the PCB,
so that Nagle algorithm is not disabled and tcp_output cannot send the remaining data immediately.

The solution is to add: pcb->flags |= TF_FIN
Maybe it's too trivial, but it works for Cameron and me.

Stephane Lesage <slesage>
Mon 22 Aug 2011 12:12:53 PM UTC, comment #2:

> The TF_FIN flag is not set in the PCB if the FIN is added to an
> existing segment in tcp_send_fin().


Could you please explain this or go into more detail on what you observed? I'm using 1.4.0 (official release, not CVS/git) and it works for me!

In tcp_send_fin(), pcb->unsent is checked and the last segment in this queue gets the FIN flag, so this should work...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 19 Aug 2011 10:57:58 AM UTC, comment #1:

Hi.
In another thread in lwip-users, I debugged the same issue and came up with the same solution.

Stephane Lesage <slesage>
Sun 07 Aug 2011 05:09:39 AM UTC, original submission:

The TF_FIN flag is not set in the PCB if the FIN is added to an existing segment in tcp_send_fin(). This causes a problem in tcp_output() where sending is stopped when it shouldn't be by the Nagle code.

Cameron Gutman <aicom>

 

Attached Files
file #23757:  FIN-patch.diff added by aicom (231B - application/octet-stream - Patch to fix the issue)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by slesage (Posted a comment)
  • -unavailable- added by aicom (Submitted the item)
  • -unavailable- added by aicom
  •  

    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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 22 Aug 2011 04:57:55 PM UTCgoldsimonStatusWorks For Me=>Fixed
      Open/ClosedOpen=>Closed
    Mon 22 Aug 2011 12:12:53 PM UTCgoldsimonStatusNone=>Works For Me
      Assigned toNone=>goldsimon
    Sun 07 Aug 2011 05:09:39 AM UTCaicomAttached File-=>Added FIN-patch.diff, #23757
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1