lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] LWIP TCP issues


From: Kieran Mansley
Subject: Re: [lwip-users] LWIP TCP issues
Date: Mon, 06 Nov 2006 13:34:27 +0000

On Mon, 2006-11-06 at 14:11 +0100, Timothy Lawrence_EUROSTAFF wrote:
> 
> > Hi 
> >      We are using LWIP in an ecos based environment. We are having 
> > problems with LWIP TCP. The udp part is communicating successfully 
> > to a external TCP/IP stack from our system. But while using TCP 
> > client to connect to a external TCP server from with in the system, 
> > it is not working. The tcp_connect results in a SYNC to the external
> > server. The server acks with a SYNC –ACK. Then a RST goes from the 
> > LWIP instead of an ACK to complete the initialization handshake. 
> >   
> > Any further settings for this would be appreciated. 
> 
> I had this problem too and I think I might have found a bug in lwIP.
> Can someone confirm or deny? 
> 
> In the tcp_output function the tcp_output_segment function is called
> and then the SYN segment is added to the unacknowledged list. If the
> SYN-ACK packet arrives before the segment is added to the list, when
> the tcp_process function tries to validate the ACK number by comparing
> it to pcb->unacked->tcphdr->seqno + 1 it fails and a reset is sent. I
> guess the solution is to add the segment to the list before call
> tcp_output_segment. 

For this race to occur, would you not have to have more than one thread
active in the core of lwIP at one time?  i.e. While you have one thread
trying to output a SYN and add the packet to the unacknowledged list,
you have another thread trying to process a received packet and compare
its seqno value to the unacknowledged list?  If this is so, you're doing
something wrong: the core of lwIP is not thread safe and your port must
protect access to it.  If I'm wrong, then it does indeed look like a
bug.

Kieran 





reply via email to

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