aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. Lars Völker <lars.voelker@technica-engineering.de>2020-01-10 12:07:28 +0100
committerPascal Quantin <pascal@wireshark.org>2020-01-10 12:51:24 +0000
commitfa2fa5657bb05cde5b598d2a490c1793bd01946c (patch)
tree4d1787f5855edfa79d08001a04d41744998f38e3
parent160a4696fafb2158fdeebdc8e41fc2fe91665675 (diff)
DLT: Fixing parsing of multiple DLT message in a single UDP packet.
The current implementation of DLT will only dissect the first message and skips all other messages in an UDP packet. Wireshark will mark all bytes in the UDP payload belonging to the first message. This is wrong and being fixed in this patch. Bug: 16321 Change-Id: I7929caaf415e59220c29a8481d8671e71b00db0c Signed-off-by: Dr. Lars Völker <lars.voelker@technica-engineering.de> Reviewed-on: https://code.wireshark.org/review/35731 Petri-Dish: Pascal Quantin <pascal@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
-rw-r--r--epan/dissectors/packet-dlt.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/epan/dissectors/packet-dlt.c b/epan/dissectors/packet-dlt.c
index 57c318bc41..578911b890 100644
--- a/epan/dissectors/packet-dlt.c
+++ b/epan/dissectors/packet-dlt.c
@@ -1,7 +1,7 @@
/* packet-dlt.c
* DLT Dissector
- * By Dr. Lars Voelker <lars-github@larsvoelker.de> / <lars.voelker@bmw.de>
- * Copyright 2013-2019 Dr. Lars Voelker
+ * By Dr. Lars Voelker <lars-github@larsvoelker.de> / <lars.voelker@bmw.de> / <lars.voelker@technica-engineering.de>
+ * Copyright 2013-2020 Dr. Lars Voelker
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
@@ -20,6 +20,7 @@
#include <epan/packet.h>
#include <epan/dissectors/packet-tcp.h>
+#include <epan/dissectors/packet-udp.h>
#include <epan/exceptions.h>
#include <epan/expert.h>
#include <epan/show_exception.h>
@@ -1127,14 +1128,14 @@ get_dlt_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset _U_, void*
}
static int
-dissect_dlt_tcp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
- tcp_dissect_pdus(tvb, pinfo, tree, TRUE, DLT_MIN_SIZE_FOR_PARSING, get_dlt_message_len, dissect_dlt_msg, NULL);
+dissect_dlt_tcp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data) {
+ tcp_dissect_pdus(tvb, pinfo, tree, TRUE, DLT_MIN_SIZE_FOR_PARSING, get_dlt_message_len, dissect_dlt_msg, data);
return tvb_reported_length(tvb);
}
static int
-dissect_dlt_udp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
- return dissect_dlt_msg(tvb, pinfo, tree, NULL);
+dissect_dlt_udp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data) {
+ return udp_dissect_pdus(tvb, pinfo, tree, DLT_MIN_SIZE_FOR_PARSING, NULL, get_dlt_message_len, dissect_dlt_msg, data);
}
void proto_register_dlt(void) {