]> git.ipfire.org Git - thirdparty/qemu.git/commit
net: do not report queued packets as sent
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Mon, 20 Aug 2012 12:35:23 +0000 (13:35 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 12 Oct 2012 02:44:18 +0000 (21:44 -0500)
commita9d8f7b1c41a8a346f4cf5a0c6963a79fbd1249e
tree0c111c2f6d3ab3aa77dd4acb8bc75ca802dc66fb
parent0d91cd5aa7ddc678f80f47041aa2ed5277172d9c
net: do not report queued packets as sent

Net send functions have a return value where 0 means the packet has not
been sent and will be queued.  A non-zero value means the packet was
sent or an error caused the packet to be dropped.

This patch fixes two instances where packets are queued but we return
their size.  This causes callers to believe the packets were sent.  When
the caller uses the async send interface this creates a real problem
because the callback will be invoked for a packet that the caller
believed to be already sent.  This bug can cause double-frees in the
caller.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
(cherry picked from commit 06b5f36d052b540a59b52150582d65674199b2ce)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
net/queue.c