buglwIP - A Lightweight TCP/IP stack - Bugs: bug #45161, tcp.c / tcp_abandon /...

 
 

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

bug #45161: tcp.c / tcp_abandon / pcb->local_port set to zero but needed later for tcp_rst

Submitted by:  Dipl. Ing. Bernhard Weber <weberbe1>
Submitted on:  Thu 21 May 2015 12:06:56 PM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Change RequestStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: git head

Thu 21 May 2015 01:45:42 PM UTC, comment #4:

Fixed, thanks for reporting.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 21 May 2015 01:44:16 PM UTC, comment #3:

Ah, I see. This has been introduced last September when fixing bug #42299 :-(

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 21 May 2015 12:36:18 PM UTC, comment #2:

the call stack is:
my software -> tcp_abort -> tcp_abandon -> tcp_rst

snipnet from tcp.c / void tcp_abandon(struct tcp_pcb *pcb, int reset)

if (send_rst) {
LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_abandon: sending RST\n"));
tcp_rst(seqno, ackno, &pcb->local_ip, &pcb->remote_ip, pcb->local_port, pcb->remote_port);
}

The reason for calling this sequence ist another big problem, but i cannot track it down to generate a good description.
It feels like: send big data chunks to a win7 x64 pc, 64k window and no data is commited for at least 700ms -> calling tcp_abort (see above), wait for reconnect from pc (7-10 ms later with valid local port number, duration without valid local port: 200-1000ms) and resend all data to pc.

Dipl. Ing. Bernhard Weber <weberbe1>
Thu 21 May 2015 12:22:09 PM UTC, comment #1:

Can you please describe the call stacks? What leads to calling tcp_abandon() and from where is tcp_rst() called?

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 21 May 2015 12:06:56 PM UTC, original submission:

In routine tcp_abandon in tcp.c pcb block will be freed with TCP_PCB_REMOVE_ACTIVE. In this routine local_port will be set to zero.
But when it is necessary to call tcp_rst later on, local port will be zero.

Therfore local_port must be stored locally before calling TCP_PCB_REMOVE_ACTIVE or TCP_RMV and for tcp_rst the local copy of local_port must be used.

Now, without this bug correction, a RST will be sent to the other computer and will be ignored. Later, an incomming ACK of a data segment cannot be commited because of the missing pcb and now, a RST with the correct port info is sent to the other computer.

RST message from 192.168.0.101 port(0) to 192.168.0.51 port 64123

        1. 00 25 90 7f 98 b8 00 0a 35 00 40 00 08 00 45 00

0010 00 28 39 4b 00 00 ff 06 00 9c c0 a8 00 65 c0 a8
0020 00 33 00 00 fa 7b 06 e2 67 12 68 ac c5 ad 50 14
0030 ff ff 97 1d 00 00 00 00 00 00 00 00

Dipl. Ing. Bernhard Weber <weberbe1>

 

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 weberbe1 (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
    Thu 21 May 2015 01:45:42 PM UTCgoldsimonStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Thu 21 May 2015 01:44:16 PM UTCgoldsimonAssigned toNone=>goldsimon
    Thu 21 May 2015 01:44:15 PM UTCgoldsimonStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1