[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Bug in SLIPIF.C ?
From: |
Jani Monoses |
Subject: |
Re: [lwip-users] Bug in SLIPIF.C ? |
Date: |
Thu, 9 Sep 2004 18:25:05 +0300 |
Hello
you did not say if this change made your slipif work or not.
> In the code fragment below there is the old faulty code and the new
> replacement:
>
> if ((p != NULL) && (recved < MAX_SIZE)) {
> ((u8_t *)p->payload)[i] = c;
> recved++;
> i++;
> if (i >= p->len) {
> i = 0;
> // p = NULL; FIXME problem if more then one buffer
> allocated by pbuf_alloc()
When can that happen? the pbuf_alloc() in that code looks like it allocates
one item in the pool (PBUF_POOL_BUFSIZE)
> p = p->next; // corrected code, to go to next buffer
> }
> }
>
> If no more data buffer space available in the chain, p->next holds a
> NULL value. This signals the driver to allocate new buffers.
>
> Is the correction above ok ?
I forgot what I knew about this slipif code so I'll have to look closer to
answer that :).
Jani