buglwIP - A Lightweight TCP/IP stack - Bugs: bug #34638, Dead code in tcp_receive -...

 
 

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

bug #34638: Dead code in tcp_receive - pcb->dupacks

Submitted by:  Amir Shalem <amirshalem>
Submitted on:  Mon 24 Oct 2011 08:50:49 PM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Fri 28 Oct 2011 11:18:22 AM UTC, comment #3:

Fixed, thanks for reporting.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 28 Oct 2011 11:14:53 AM UTC, comment #2:

Yup, the cast is missing. I don't remember the mail from 2010, though. Was there a bug entry for it?

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 24 Oct 2011 10:07:29 PM UTC, comment #1:

The intent I think was to prevent dupacks from overflowing (wrapping). But it can't work without a cast:

if ((u8_t) (pcb->dupacks + 1) > pcb->dupacks)
++pcb->dupacks;

I seem to remember this coming up in the past. Yeah:

https://lists.nongnu.org/archive/html/lwip-users/2010-02/msg00231.html

Bill Auerbach <billauerbach>
Mon 24 Oct 2011 08:50:49 PM UTC, original submission:

In tcp_receive() function, line 941
http://git.savannah.gnu.org/cgit/lwip.git/tree/src/core/tcp_in.c#n941

there is dead code (new gcc yelled about it):

if (pcb->dupacks + 1 > pcb->dupacks)
++pcb->dupacks;

as I don't understand the code around it yet I don't offer a patch also.

doesn't anybody knows whats the correct code?

thanks,
amir.

Amir Shalem <amirshalem>

 

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 billauerbach (Posted a comment)
  • -unavailable- added by amirshalem (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
    Fri 28 Oct 2011 11:18:22 AM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
      Planned Release=>1.4.1

    Back to the top


    Powered by Savane 3.1-cleanup1