lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #34525] Queueing a packet for nd leaks memory


From: Simon Goldschmidt
Subject: [lwip-devel] [bug #34525] Queueing a packet for nd leaks memory
Date: Tue, 11 Oct 2011 10:52:44 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1

Update of bug #34525 (project lwip):

                  Status:                    None => Invalid                
             Assigned to:                    None => goldsimon              
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #4:

Oh, that explains your "bug" then (and you would find the same bug in
IPv4/etharp or when using raw PCBs).

In general, pbufs have a reference counter and the initial reference (after
allocation) is not silently transferred from your application to lwIP.
Instead, if the lwIP code keeps a pointer to a pbuf somewhere, it increases
its ref-count (e.g. nd6.c:1562). The application is responsible for giving up
its own reference when it does not need it any more (i.e. after sending the
pbuf). Plus there's an extra rule that pbufs passed to a send-function that
returns success may not be used any more (i.e. don't send the same pbuf
twice).

The pbuf you saw freed in udp_sendto() is not the pbuf that you pass in for
sending but an extra pbuf which is allocated for protocol headers (which is
only allocated if the headers don't fit into your original pbuf - otherwise,
nothing is freed on error).

Closing this as invalid.

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/




reply via email to

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