aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gtphub.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-12-07 13:36:47 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-12-08 12:21:15 +0100
commit36948bf7c71d89746314e93ffe8f3eb2c2fbc5ea (patch)
tree716bc8ef3400b5286d4860fc69ceb686b9f9a819 /openbsc/src/gprs/gtphub.c
parent4d2b3ff6a235ff42ba839ca782f187a321c3e6a4 (diff)
gtphub: log: limit length of hex dumps.
The debug log prints the received/sent bytes in hex. When this data surpasses the buffer size available for the log string (4096), the log is truncated and lacks a newline character. Limit the amount of dumped bytes to 1000. Sponsored-by: On-Waves ehi
Diffstat (limited to 'openbsc/src/gprs/gtphub.c')
-rw-r--r--openbsc/src/gprs/gtphub.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c
index a68fa6567..f26a56ace 100644
--- a/openbsc/src/gprs/gtphub.c
+++ b/openbsc/src/gprs/gtphub.c
@@ -942,9 +942,10 @@ static int gtphub_read(const struct osmo_fd *from,
return 0;
}
- LOG(LOGL_DEBUG, "Received %d bytes from %s: %s\n",
+ LOG(LOGL_DEBUG, "Received %d bytes from %s: %s%s\n",
(int)received, osmo_sockaddr_to_str(from_addr),
- osmo_hexdump(buf, received));
+ osmo_hexdump(buf, received > 1000? 1000 : received),
+ received > 1000 ? "..." : "");
return received;
}