lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] tcp_output_segment() length problems


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] tcp_output_segment() length problems
Date: Wed, 08 Jan 2003 22:18:48 -0000

Hi Leon!

On Wednesday 19 December 2001 16.16, you wrote:
> using lwIP 0.5, along with a scaled down httpd.c, that merely says
> "Hello, World" (at least, that's the goal for the moment).
>
> I'm experiencing an error in where the "seg->p->tot_len" is corrupt upon
> calling "inet_chksum_pseudo()" within "tcp_output_segment()".

I've never came across any such problems before... Could you post the part of 
your code that does the actual data transmission? Perhaps that could give 
some more insights.

Perhaps the problem is within the tcp_enqueue() function, if the data is to 
be prepended to already queued data.

Does the problem occur when doing a retransmission?

> Why are the "seg->p->len" and "seg->p->tot_len" saved and restored
> over the "ip_output()" call? Did you experience corrupt lengths there?

The reason is that IP calls pbuf_header() that manipulates the len and 
tot_len variables. Since TCP will queue the segment, it doesn't really want 
to have the len and tot_len to include the IP headers. Yes, I know this is a 
stupid approach... A better way is to let the retransmission code act as if 
the IP header is already put in front of the TCP header. In fact, the code is 
already evolving that way.

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]




reply via email to

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