summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2013-02-01 10:48:29 +0900
committerLorenzo Colitti <lorenzo@google.com>2013-02-01 10:49:49 +0900
commitf68200ab1a5c559866a87e51d0d52e3c74b02343 (patch)
treea311bd45836235d361612d576b7182b8dab37103
parent70aba57df0f4a0ee800e7ba3694dbd9b6302a470 (diff)
downloadandroid-clat-jb-mr1-dev-plus-aosp.tar.gz
Don't compile packet dumping code by default.jb-mr1-dev-plus-aosp
Bug: 7664960 Change-Id: Ieb56bcc010d0e12264d43e0a0dfcb1beb479d4e2
-rw-r--r--debug.h2
-rw-r--r--dump.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/debug.h b/debug.h
index ba4971b..8e09672 100644
--- a/debug.h
+++ b/debug.h
@@ -18,7 +18,7 @@
#ifndef __DEBUG_H__
#define __DEBUG_H__
-// set to 1 to enable debug logging
+// set to 1 to enable debug logging and packet dumping.
#define CLAT_DEBUG 0
#endif /* __DEBUG_H__ */
diff --git a/dump.c b/dump.c
index 3e4a6cc..e538f3e 100644
--- a/dump.c
+++ b/dump.c
@@ -28,10 +28,13 @@
#include <netinet/icmp6.h>
#include <linux/icmp.h>
+#include "debug.h"
#include "checksum.h"
#include "clatd.h"
#include "logging.h"
+#if CLAT_DEBUG
+
/* print ip header */
void dump_ip(struct iphdr *header) {
u_int16_t frag_flags;
@@ -223,3 +226,5 @@ void logcat_hexdump(const char *info, const char *data, size_t len) {
logmsg(ANDROID_LOG_WARN,"info %s len %d data %s", info, len, output);
}
+
+#endif // CLAT_DEBUG