aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-kafka.c
diff options
context:
space:
mode:
authorJoerg Mayer <jmayer@loplof.de>2018-04-13 17:41:20 +0200
committerAnders Broman <a.broman58@gmail.com>2018-04-15 05:34:08 +0000
commit0d31ec328f2c523cfc4655f1674a5f0eae80923f (patch)
tree5e4f3bd287c01af8baeb65dc4d1286a9d126db8a /epan/dissectors/packet-kafka.c
parent08c234445855bdc038912b943499511fd97e0d91 (diff)
Check for HAVE_LZ4FRAME_H in the LZ4 detection process and use it
Change-Id: I919621b8c4c809eb181d563251eeb099b767ad82 Reviewed-on: https://code.wireshark.org/review/26940 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Jörg Mayer <jmayer@loplof.de> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-kafka.c')
-rw-r--r--epan/dissectors/packet-kafka.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/epan/dissectors/packet-kafka.c b/epan/dissectors/packet-kafka.c
index 71fc71502b..2d8045b19c 100644
--- a/epan/dissectors/packet-kafka.c
+++ b/epan/dissectors/packet-kafka.c
@@ -21,12 +21,9 @@
#ifdef HAVE_SNAPPY
#include <snappy-c.h>
#endif
-#ifdef HAVE_LZ4
+#ifdef HAVE_LZ4FRAME_H
#include <lz4.h>
-#if LZ4_VERSION_NUMBER >= 10500
#include <lz4frame.h>
-#define HAVE_LZ4_FRAME
-#endif /* LZ4_VERSION_NUMBER >= 10500 */
#endif
#include "packet-tcp.h"
@@ -346,7 +343,7 @@ dissect_kafka_message_set(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
/* HELPERS */
-#ifdef HAVE_LZ4_FRAME
+#ifdef HAVE_LZ4FRAME_H
/* Local copy of XXH32() algorithm as found in https://github.com/lz4/lz4/blob/v1.7.5/lib/xxhash.c
as some packagers are not providing xxhash.h in liblz4 */
typedef struct {
@@ -459,7 +456,7 @@ static guint XXH32(const void* input, size_t len, guint seed)
else
return XXH32_endian(input, len, seed, XXH_bigEndian);
}
-#endif /* HAVE_LZ4_FRAME */
+#endif /* HAVE_LZ4FRAME_H */
static const char *
kafka_error_to_str(kafka_error_t error)
@@ -820,7 +817,7 @@ dissect_kafka_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int s
break;
#endif
case KAFKA_MESSAGE_CODEC_LZ4:
-#ifdef HAVE_LZ4_FRAME
+#ifdef HAVE_LZ4FRAME_H
raw = kafka_get_bytes(subtree, tvb, pinfo, offset);
offset += 4;
if (raw) {
@@ -910,7 +907,7 @@ dissect_kafka_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int s
offset += compressed_size;
}
break;
-#endif /* HAVE_LZ4_FRAME */
+#endif /* HAVE_LZ4FRAME_H */
case KAFKA_MESSAGE_CODEC_NONE:
default: