lwip-devel
[Top][All Lists]
Advanced

[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


From: Ambroz Bizjak
Subject: [lwip-devel] [bug #52113] recv callback: To free or not to free pbuf when returning ERR_ABRT?
Date: Mon, 25 Sep 2017 15:42:11 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36

URL:
  <http://savannah.nongnu.org/bugs/?52113>

                 Summary: recv callback: To free or not to free pbuf when
returning ERR_ABRT?
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: abizjak
            Submitted on: Mon 25 Sep 2017 07:42:10 PM UTC
                Category: TCP
                Severity: 3 - Normal
              Item Group: Change Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

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
unclear:

"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
ERR_OK"?

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:

  <http://savannah.nongnu.org/bugs/?52113>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]