[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-devel] tcp_receive(): Wrong tot_len when trsee immingfirst edg
From: |
K.J. Mansley |
Subject: |
RE: [lwip-devel] tcp_receive(): Wrong tot_len when trsee immingfirst edge |
Date: |
24 May 2004 15:16:56 +0100 |
I've had a look, and think that a change does need to be made. I
propose the following (tcp_in.c, line 921):
off = pcb->rcv_nxt - seqno;
p = inseg.p;
if (inseg.p->len < off) {
new_tot_len = inseg.p->tot_len - off;
while (p->len < off) {
off -= p->len;
/* KJM following line changed (with addition of new_tot_len var)
to fix bug #
inseg.p->tot_len -= p->len; */
p->tot_len = new_tot_len;
p->len = 0;
p = p->next;
}
pbuf_header(p, -off);
} else {
pbuf_header(inseg.p, -off);
}
/* KJM following line changed to use p->payload rather than
inseg->p->payload
to fix bug # */
inseg.dataptr = p->payload;
inseg.len -= pcb->rcv_nxt - seqno;
inseg.tcphdr->seqno = seqno = pcb->rcv_nxt;
This is almost identical to the correction in the original email, with a
couple of minor changes. It should also correctly set inseg.dataptr.
I've commented the affected lines so it should be clear to anyone
investigating failures that are caused as a result of this change what
I've done.
If anyone could cast their eye over it before I commit the change and
point out anything I've missed I'd be grateful.
Also, Leon: you suggested commiting this to a particular branch. Is
that the default/normal one at the moment, or do I need to do something
special before checking in? I've lost track of which we normally commit
to.
Thanks
Kieran