buglwIP - A Lightweight TCP/IP stack - Bugs: bug #10548, Problem w/ TCP_SEQ_BETWEEN at ONE...

 
 

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

bug #10548: Problem w/ TCP_SEQ_BETWEEN at ONE place in tcp_in.c

Submitter:  None
Submitted:  Fri 01 Oct 2004 02:11:49 PM UTC
   
 
Category:  TCP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  leonwoestenberg
Open/Closed:  Closed Planned Release:  None
lwIP version:  None

Sun 26 Dec 2004 01:46:49 PM UTC, comment #3: 

I am closing this bug now the published workaround both works, is implemented in lwIP, and documented as such in the code.

Leon Woestenberg <likewise>
Group Member
Sat 16 Oct 2004 01:09:05 PM UTC, comment #2: 

I think Leon has now checked in a fix to this bug.

Kieran Mansley <kieranm>
Group Member
Sun 03 Oct 2004 02:37:02 PM UTC, comment #1: 

The call to the macro TCP_SEQ_BETWEEN(a,b,c) causes (b) to
be evaluated twice on LITTLE_ENDIAN machines because of the
call to ntohl().  This produces more code (at least on the ARM).  As a current work around, I have left all of the code in tcp_in.c untouched and changed the TCP_SEQ_BETWEEN() macro in tcp.h to
(TCP_SEQ_GEQ(a,b) && TCP_SEQ_LEQ(a,c))
This both works and produces less code.
-email is unavailable-

Anonymous
Fri 01 Oct 2004 02:11:49 PM UTC, original submission:  

I just finished a port from lwIP-0.7.2 to the current code in CVS.  The processor is an LPC2292 with a CS8900 ethernet chip.  The LPC is an ARM7TDMI which operates in LITTLE_ENDIAN mode.  The problem shows up for me when using Adam's minimal http server.  I have isolated it to the TCP_SEQ_BETWEEN in tcp_in.c at line 822.  When I use the
previous macros, the code serves pages just fine.  When I use the new macro, it does not.  The code fragment that works is:

  while (pcb->unsent != NULL &&
         TCP_SEQ_LEQ(ntohl(pcb->unsent->tcphdr->seqno) +
         TCP_TCPLEN(pcb->unsent), ackno) &&
         TCP_SEQ_LEQ(ackno, pcb->snd_max)
         /*TCP_SEQ_BETWEEN(ackno,
           ntohl(pcb->unsent->tcphdr->seqno) +
           TCP_TCPLEN(pcb->unsent), pcb->snd_max)*/

So far I have been unable to determine why in this instance the macro does not work.  Maybe something to do with LITTLE_ENDIAN.  Maybe another set of eyes can spot it.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-12-26 likewise Open/ClosedOpen Closed
2004-10-16 kieranm StatusNone Fixed
    Assigned toNone leonwoestenberg

Back to the top

Powered by Savane 3.15-b2d0.
Corresponding source code