[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] fix assert triggered in tcp_in.c
From: |
Leon Woestenberg |
Subject: |
Re: [lwip-users] fix assert triggered in tcp_in.c |
Date: |
Sat, 08 Apr 2006 00:57:37 +0200 |
User-agent: |
Thunderbird 1.5 (Windows/20051201) |
Hello all,
reviewing the effects of the proposed fix (and seeing how inseg.p is
really used), I came upon this hack commented in
tcp_in.c as follows:
What is done is really quite a nasty hack: the first pbuf in
the pbuf chain is pointed to by inseg.p. Since we need to be
able to deallocate the whole pbuf, we cannot change this
inseg.p pointer to point to any of the later pbufs in the
chain. Instead, we point the ->payload pointer in the first
pbuf to data in one of the later pbufs. We also set the
inseg.data pointer to point to the right place. This way, the
->p pointer will still point to the first pbuf, but the
->p->payload pointer will point to data in another pbuf.
As far as I can tell the current pbuf_*() functions do not assume the
payload
buffer to be inside their own pbuf and therefore this has always worked
(and still should).
I was never aware of this hack before though, not being involved with
the TCP part of lwIP much.
Regards,
Leon.