buglwIP - A Lightweight TCP/IP stack - Bugs: bug #38468, tcp_sent() not called on half-open...

 
 

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

bug #38468: tcp_sent() not called on half-open connection for data ACKed with the same ack as FIN

Submitted by:  Valery Ushakov <uwe>
Submitted on:  Tue 05 Mar 2013 02:12:05 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

Sat 21 Mar 2015 08:00:07 PM UTC, comment #2:

Fixed, thanks for reporting.

In applications like these, you have to take special care about not referencing the pcb after tcp_close() returns success. However, this bugfix should ensure you either get all 'sent' events or an 'err' callback, even though you don't reference the pcb any more.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sat 21 Mar 2015 07:40:53 PM UTC, comment #1:

I do think this is a bug: we should issue TCP_EVENT_SENT() in the TF_CLOSED case, too.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 05 Mar 2013 02:12:05 AM UTC, original submission:

I'm not sure if it's a bug or if I'm doing something wrong, so feel free
to close as invalid.

I have a pcb that ignores input and sends a blob of data as fast as it
can. The client that connects to that pcb immediately half-closes after
connect. When pcb is done sending it shuts down its end of the
connection too, it doesn't wait for all data to be acked before shutting
down, but it keeps tcp_sent() and tcp_err() callbacks in place and
tracks acks.

When peer receives all data and the FIN from the pcb it will send the
final datagram that ACKs both the last bit of data and the FIN.

After calling tcp_process(), tcp_input() sees TF_CLOSED in recv_flags
and goes into that else-if branch that does TCP_EVENT_ERR(ERR_CLSD) and
doesn't do TCP_EVENT_SENT(pcb->acked) for the last chunk of acked data.

As a workaround I can do in my tcp_err() callback something along the
lisnes of:
which mimics missing TCP_EVENT_SENT (a few lines later in tcp_input() in
the else branch).

Valery Ushakov <uwe>

 

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 (Posted a comment)
  • -unavailable- added by uwe (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 21 Mar 2015 08:00:18 PM UTCgoldsimonStatusIn Progress=>Fixed
    Sat 21 Mar 2015 08:00:07 PM UTCgoldsimonOpen/ClosedOpen=>Closed
    Sat 21 Mar 2015 07:40:53 PM UTCgoldsimonStatusNone=>In Progress
      Assigned toNone=>goldsimon

    Back to the top


    Powered by Savane 3.1-cleanup1