[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-members] pbuf_header() now does not work for PBUF_REF and PBU
From: |
Kieran Mansley |
Subject: |
Re: [lwip-members] pbuf_header() now does not work for PBUF_REF and PBUF_ROM |
Date: |
Mon, 31 Mar 2003 17:12:03 +0100 (BST) |
On Mon, 31 Mar 2003, David Haas wrote:
> Leon,
>
> The current version of pbuf_header() is broken for PBUF_REF and
> PBUF_ROM. It should fail and not change the payload pointer. Instead it
> is returning 0 and changing the payload pointer. Would you mind if I fix
> it?
I'm not so sure this is broken, or rather that your change would be less
broken! The stack will fail in a big heap if pbuf_header doesn't do what
it expects. In particular when packets are received pbuf_header is used
with a negative value to hide the (for example) ip header from the tcp
stack and so on. This is completely valid for both PBUF_REF and PBUF_ROM,
and I would envisage people using PBUF_REF to receive packets on high
performance networks. Perhaps we should change it so that it only
succeeds if it moves to within the boundaries of the original pbuf?
Kieran