lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bugs #10548] Problem w/ TCP_SEQ_BETWEEN at ONE place in tc


From: anonymous
Subject: [lwip-devel] [bugs #10548] Problem w/ TCP_SEQ_BETWEEN at ONE place in tcp_in.c
Date: Sun, 03 Oct 2004 10:43:43 -0400
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)

This mail is an automated notification from the bugs tracker
 of the project: lwIP - A Lightweight TCP/IP stack.

/**************************************************************************/
[bugs #10548] Latest Modifications:

Changes by: Anonymous user
Date:  
                Sun 10/03/2004 at 10:37

------------------ Additional Follow-up Comments ----------------------------
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.
address@hidden







/**************************************************************************/
[bugs #10548] Full Item Snapshot:

URL: <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=10548>
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: 0
On: Fri 10/01/2004 at 10:11

Category:  TCP
Severity:  5 - Average
Item Group:  Faulty Behaviour
Resolution:  None
Privacy:  Public
Assigned to:  None
Status:  Open


Summary:  Problem w/ TCP_SEQ_BETWEEN at ONE place in tcp_in.c

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.


Follow-up Comments
------------------


-------------------------------------------------------
Date: Sun 10/03/2004 at 10:37       By: 0 <None>
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.
address@hidden













For detailed info, follow this link:
<http://savannah.nongnu.org/bugs/?func=detailitem&item_id=10548>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]