Hello,

I have encounted a collision problem in PBUF_RAM. udp.c uses
pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM) and this buffer will be queued for
transmission in the ethernet driver. The reference count of this buffer is
increased in the ethernet layer, and the buffer is freed at a later point
when it has been transmitted.

I have noticed that (sometimes) the pbuf allocated in udp.c points to the
same payload which is used by a pbuf (also previously allocated in udp.c)
waiting to be transmitted. The pbuf's differs but they point to the same
payload. The pbuf waiting to be transmitted has not been freed at the point
udp.c allocates a new pbuf (the reference count is 2).

I use

#define MEM_ALIGNMENT 8
#define MEM_SIZE 128000

and have not encountered any strange numbers in lwip_stats for the memory
management.

PBUF_RAM is not used except for the native lwip usage. The reception buffers
is allocated by using PBUF_POOL, and PBUF_REF is used to send UDP data.

Does anybody have any suggestions?

Regards,
Marcus
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to