[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #59974] pbuf_alloc failed
From: |
mike |
Subject: |
[lwip-devel] [bug #59974] pbuf_alloc failed |
Date: |
Sat, 30 Jan 2021 03:40:50 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0 |
URL:
<https://savannah.nongnu.org/bugs/?59974>
Summary: pbuf_alloc failed
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: hk517j
Submitted on: Sat 30 Jan 2021 08:40:48 AM UTC
Category: pbufs
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
lwIP version: 2.1.0
_______________________________________________________
Details:
Hi,I am Mike,an embedded software engineer. Here is the problem I faced:
Ping the MCU board which runs LWIP 2.1.0 with ping 192.168.0.30 -l 65500 on
computer windows 10. and 65500 is the maximal bytes that windows 10 can ping.
But the result is failed.
I know that you tried to fix bug #50040 before, which just to check the
overflow and if the size is too large, pbuf_alloc would return NULL. but that
would cause a bug: ping 65500 bytes would fail. I think LWIP should support
ping 65500 bytes because windows 10 can ping maximal 65500 bytes and some
international tech standards force embedded system to support UDP packet which
is maximal 64KB.
I have read bug #50040 you fixed before, maybe it was not solved completely.
My MCU board have a extern ram which has more than 1 MB ram, and lwip uses the
ram, heap is on the exteran ram. The mcu board has sufficient ram to malloc.
so I modified the code line 274 in pbuf.c, change u16_t to mem_size_t, then
ping 65500 bytes successfully. here is the code:
case PBUF_RAM: {
// u16_t payload_len = (u16_t)(LWIP_MEM_ALIGN_SIZE(offset) +
LWIP_MEM_ALIGN_SIZE(length));
mem_size_t payload_len = (mem_size_t)(LWIP_MEM_ALIGN_SIZE(offset) +
LWIP_MEM_ALIGN_SIZE(length));
Hope to hear back on your opinion.
_______________________________________________________
Reply to this item at:
<https://savannah.nongnu.org/bugs/?59974>
_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/
- [lwip-devel] [bug #59974] pbuf_alloc failed,
mike <=