[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 52/65] slirp: replace a DEBUG block with WITH_ICMP_ER
From: |
Samuel Thibault |
Subject: |
[Qemu-devel] [PULL 52/65] slirp: replace a DEBUG block with WITH_ICMP_ERROR_MSG |
Date: |
Mon, 14 Jan 2019 01:03:13 +0100 |
From: Marc-André Lureau <address@hidden>
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é Lureau <address@hidden>
Signed-off-by: Samuel Thibault <address@hidden>
---
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"
+#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[] = "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_char
code, int minsize,
HTONS(icp->icmp_ip.ip_id);
HTONS(icp->icmp_ip.ip_off);
-#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=strlen(message);
@@ -329,7 +332,6 @@ icmp_send_error(struct mbuf *msrc, u_char type, u_char
code, int minsize,
memcpy(cpnt, message, message_len);
m->m_len+=message_len;
}
-#endif
icp->icmp_cksum = 0;
icp->icmp_cksum = cksum(m, m->m_len);
--
2.20.1
- [Qemu-devel] [PULL 47/65] slirp: drop <Vista compatibility, (continued)
- [Qemu-devel] [PULL 47/65] slirp: drop <Vista compatibility, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 59/65] slirp: factor out guestfwd addition checks, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 60/65] slirp: add clock_get_ns() callback, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 49/65] slirp: use virtual time for packet expiration, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 53/65] slirp: no need to make DPRINTF conditional on DEBUG, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 62/65] slirp: set G_LOG_DOMAIN, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 50/65] slirp: replace a fprintf with g_critical(), Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 58/65] slirp: replace DEBUG_ARGS with DEBUG_ARG, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 63/65] slirp: call into g_debug() for DEBUG macros, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 55/65] slirp: introduce SLIRP_DEBUG environment variable, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 52/65] slirp: replace a DEBUG block with WITH_ICMP_ERROR_MSG,
Samuel Thibault <=
- [Qemu-devel] [PULL 51/65] slirp: replace some fprintf() with DEBUG_MISC, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 54/65] slirp: always build with debug statements, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 56/65] slirp: use %p for pointers format, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 48/65] slirp: rename exec_list, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 57/65] slirp: remove remaining DEBUG blocks, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 64/65] slirp: Mark debugging calls as unlikely, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 65/65] slirp: check data length while emulating ident function, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 61/65] build-sys: use a seperate slirp-obj-y && slirp.mo, Samuel Thibault, 2019/01/13
- Re: [Qemu-devel] [PULLv2 00/65] slirp updates, no-reply, 2019/01/13