From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6kK0-0002OU-PT for qemu-devel@nongnu.org; Wed, 29 Aug 2012 11:36:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6kJv-0005Tp-1l for qemu-devel@nongnu.org; Wed, 29 Aug 2012 11:36:48 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:37766) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6kJu-0005Tf-SF for qemu-devel@nongnu.org; Wed, 29 Aug 2012 11:36:42 -0400 Received: by weyz53 with SMTP id z53so386949wey.4 for ; Wed, 29 Aug 2012 08:36:42 -0700 (PDT) Date: Wed, 29 Aug 2012 16:36:39 +0100 From: Stefan Hajnoczi Message-ID: <20120829153639.GD26167@stefanha-thinkpad.localdomain> References: <1345468960-15558-1-git-send-email-stefanha@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1345468960-15558-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH] net: do not report queued packets as sent List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org On Mon, Aug 20, 2012 at 02:22:40PM +0100, Stefan Hajnoczi wrote: > 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 > --- > net/queue.c | 35 ++++++++++++++++------------------- > 1 file changed, 16 insertions(+), 19 deletions(-) Applied to the net tree: https://github.com/stefanha/qemu/commits/net Stefan