[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #52113] recv callback: To free or not to free pbuf whe
[lwip-devel] [bug #52113] recv callback: To free or not to free pbuf when returning ERR_ABRT?
Mon, 25 Sep 2017 15:42:11 -0400 (EDT)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36
Summary: recv callback: To free or not to free pbuf when
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: abizjak
Submitted on: Mon 25 Sep 2017 07:42:10 PM UTC
Severity: 3 - Normal
Item Group: Change Request
Assigned to: None
Discussion Lock: Any
Planned Release: None
lwIP version: git head
After a quick look at the code around the invocation of the TCP recv callback,
I have come to believe one must free the pbuf if returning ERR_ABRT.
However, according to rawapi.txt one should not free it or at least it is very
"If there are no errors and the callback function is to return
ERR_OK, then it must free the pbuf. Otherwise, it must not free the pbuf so
that lwIP core code can store it."
The unclear part being "If there are no errors and the callback function is to
return ERR_OK" - is this a logical conjunction (which leaves "errors" open to
interpretation) or just a weird way to say "if the callback function returns
I think it should say: "If the callback function returns ERR_OK or ERR_ABRT it
must have freed the pbuf, otherwise it must not have freed it."
Reply to this item at:
Message sent via/by Savannah
- [lwip-devel] [bug #52113] recv callback: To free or not to free pbuf when returning ERR_ABRT?,
Ambroz Bizjak <=