aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-10-19 11:03:15 -0400
committerMichael Mann <mmann78@netscape.net>2016-10-19 22:57:50 +0000
commit404c31492be8b01d1b6bf9944ea3bb71feb92dd6 (patch)
treeac21addc2f477f354c1a53503eed85262223457a
parentbd057c8dd226dd3c33104b95310ac592d7a19b09 (diff)
Skype: Remove TCP heuristic dissection
It was taking any/all TCP packets. Also clean up a little of the UDP heuristic. Change-Id: Iae08e79c0d71e4676cfc7821372ab9581c1d1cfc Ping-Bug: 13029 Reviewed-on: https://code.wireshark.org/review/18322 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-skype.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/epan/dissectors/packet-skype.c b/epan/dissectors/packet-skype.c
index 4139af46d5..5b259cd29d 100644
--- a/epan/dissectors/packet-skype.c
+++ b/epan/dissectors/packet-skype.c
@@ -291,20 +291,21 @@ static gboolean
test_skype_udp(tvbuff_t *tvb)
{
/* Minimum of 3 bytes, check for valid message type */
- guint length = tvb_captured_length(tvb);
- guint8 type = tvb_get_guint8(tvb, 2) & 0xF;
- if ( length >= 3 &&
- ( type == 0 ||
+ if (tvb_captured_length(tvb) > 3)
+ {
+ guint8 type = tvb_get_guint8(tvb, 2) & 0xF;
+ if ( type == 0 ||
/* FIXME: Extend this by minimum or exact length per message type */
- type == 2 ||
- type == 3 ||
- type == 5 ||
- type == 7 ||
- type == 0xd ||
- type == 0xf
- )
- ) {
- return TRUE;
+ type == 2 ||
+ type == 3 ||
+ type == 5 ||
+ type == 7 ||
+ type == 0xd ||
+ type == 0xf
+ )
+ {
+ return TRUE;
+ }
}
return FALSE;
}
@@ -312,12 +313,11 @@ test_skype_udp(tvbuff_t *tvb)
static gboolean
dissect_skype_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- if (pinfo->ptype == PT_UDP) {
- if ( !test_skype_udp(tvb) ) {
- return FALSE;
- }
- dissect_skype_udp(tvb, pinfo, tree);
+ if ( !test_skype_udp(tvb) ) {
+ return FALSE;
}
+
+ dissect_skype_udp(tvb, pinfo, tree);
return TRUE;
}
@@ -447,7 +447,6 @@ proto_reg_handoff_skype(void)
dissector_add_for_decode_as_with_preference("tcp.port", skype_handle);
dissector_add_for_decode_as_with_preference("udp.port", skype_handle);
- heur_dissector_add("tcp", dissect_skype_heur, "Skype over TCP", "skype_tcp", proto_skype, HEURISTIC_DISABLE);
heur_dissector_add("udp", dissect_skype_heur, "Skype over UDP", "skype_udp", proto_skype, HEURISTIC_DISABLE);
}