From patchwork Mon Dec 14 13:51:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 556510 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A44B0140187 for ; Tue, 15 Dec 2015 00:55:26 +1100 (AEDT) Received: from localhost ([::1]:60150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8Tb2-0006KF-Fo for incoming@patchwork.ozlabs.org; Mon, 14 Dec 2015 08:55:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8TXK-0000Q6-E0 for qemu-devel@nongnu.org; Mon, 14 Dec 2015 08:51:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8TXH-0003oI-6M for qemu-devel@nongnu.org; Mon, 14 Dec 2015 08:51:34 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:53406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8TXH-0003o5-0R for qemu-devel@nongnu.org; Mon, 14 Dec 2015 08:51:31 -0500 X-IronPort-AV: E=Sophos;i="5.20,427,1444687200"; d="scan'208";a="191983755" Received: from unknown (HELO var.ipv6) ([193.50.110.80]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 14 Dec 2015 14:51:30 +0100 Received: from samy by var.ipv6 with local (Exim 4.86) (envelope-from ) id 1a8TXF-0003nk-QL; Mon, 14 Dec 2015 14:51:29 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Mon, 14 Dec 2015 14:51:20 +0100 Message-Id: <1450101088-14575-1-git-send-email-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.6.2 In-Reply-To: <20151214134939.GA3142@var.bordeaux.inria.fr> References: <20151214134939.GA3142@var.bordeaux.inria.fr> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.83 Cc: Thomas Huth , zhanghailiang , Li Zhijian , Stefan Hajnoczi , Jason Wang , Dave Gilbert , Vasiliy Tolstov , Huangpeng , Gonglei , Jan Kiszka , Samuel Thibault , Yang Hongyang , Guillaume Subiron Subject: [Qemu-devel] [PATCH 1/9] slirp: goto bad in udp_input if sosendto fails X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Guillaume Subiron Before this patch, if sosendto fails, udp_input is executed as if the packet was sent, recording the packet for icmp errors, which does not makes sense since the packet was not actually sent, errors would be related to a previous packet. This patch adds a goto bad to cut the execution of this function. Signed-off-by: Guillaume Subiron Signed-off-by: Samuel Thibault Reviewed-by: Thomas Huth --- slirp/udp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/slirp/udp.c b/slirp/udp.c index fee13b4..ce63414 100644 --- a/slirp/udp.c +++ b/slirp/udp.c @@ -218,6 +218,7 @@ udp_input(register struct mbuf *m, int iphlen) *ip=save_ip; DEBUG_MISC((dfd,"udp tx errno = %d-%s\n",errno,strerror(errno))); icmp_error(m, ICMP_UNREACH,ICMP_UNREACH_NET, 0,strerror(errno)); + goto bad; } m_free(so->so_m); /* used for ICMP if error on sorecvfrom */