From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:35299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjB7L-0004p4-6K for qemu-devel@nongnu.org; Mon, 14 Jan 2019 17:54:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjB7K-0001lb-Da for qemu-devel@nongnu.org; Mon, 14 Jan 2019 17:54:03 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:40660) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjB7K-0001aE-49 for qemu-devel@nongnu.org; Mon, 14 Jan 2019 17:54:02 -0500 From: Samuel Thibault Date: Mon, 14 Jan 2019 23:52:53 +0100 Message-Id: <20190114225306.21569-53-samuel.thibault@ens-lyon.org> In-Reply-To: <20190114225306.21569-1-samuel.thibault@ens-lyon.org> References: <20190114225306.21569-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 52/65] slirp: replace a DEBUG block with WITH_ICMP_ERROR_MSG List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , stefanha@redhat.com, jan.kiszka@siemens.com, Samuel Thibault From: Marc-Andr=C3=A9 Lureau icmp_send_error() doesnt actually log messages when DEBUG is enabled. Let's use a different define that describes better the tweaked behaviour of the function, and avoid uncompiled code. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Samuel Thibault --- slirp/ip_icmp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/slirp/ip_icmp.c b/slirp/ip_icmp.c index af11cfcefe..6c7e375ff8 100644 --- a/slirp/ip_icmp.c +++ b/slirp/ip_icmp.c @@ -34,6 +34,10 @@ #include "slirp.h" #include "ip_icmp.h" =20 +#ifndef WITH_ICMP_ERROR_MSG +#define WITH_ICMP_ERROR_MSG 0 +#endif + /* The message sent when emulating PING */ /* Be nice and tell them it's just a pseudo-ping packet */ static const char icmp_ping_msg[] =3D "This is a pseudo-PING packet used= by Slirp to emulate ICMP ECHO-REQUEST packets.\n"; @@ -319,8 +323,7 @@ icmp_send_error(struct mbuf *msrc, u_char type, u_cha= r code, int minsize, HTONS(icp->icmp_ip.ip_id); HTONS(icp->icmp_ip.ip_off); =20 -#ifdef DEBUG - if(message) { /* DEBUG : append message to ICMP packet */ + if (message && WITH_ICMP_ERROR_MSG) { /* append message to ICMP packet= */ int message_len; char *cpnt; message_len=3Dstrlen(message); @@ -329,7 +332,6 @@ icmp_send_error(struct mbuf *msrc, u_char type, u_cha= r code, int minsize, memcpy(cpnt, message, message_len); m->m_len+=3Dmessage_len; } -#endif =20 icp->icmp_cksum =3D 0; icp->icmp_cksum =3D cksum(m, m->m_len); --=20 2.20.1