aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rtcp.c
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2015-07-13 13:14:42 -0400
committerMichael Mann <mmann78@netscape.net>2015-07-14 03:44:03 +0000
commitb19846d40eff42c28f8209e07f9c193736710749 (patch)
treea5a64953df6d9754d582e1904a4c87e11eb762ad /epan/dissectors/packet-rtcp.c
parent873d5980cd1d83b7f6728657b98a37c3a882f5e7 (diff)
RTCP heuristic only matches odd port-number TURN ChannelData packets
RTCP can be carried within TURN CannelData messages, or STUN/TURN Send messages. The TURN message can be in UDP or TCP, of any port number (by default the even port 3478). So the RTCP heuristic dissector used inside the TURN ChannelData/Send payload needs to match regardless of the port number of the packet. Bug: 11336 Change-Id: I155b87c3e666478d3245366784d7d4e49c8e42c8 Reviewed-on: https://code.wireshark.org/review/9624 Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-rtcp.c')
-rw-r--r--epan/dissectors/packet-rtcp.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c
index 4f871d9dd8..ab07249ec9 100644
--- a/epan/dissectors/packet-rtcp.c
+++ b/epan/dissectors/packet-rtcp.c
@@ -812,12 +812,6 @@ dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
return FALSE;
}
- /* Was it sent to an odd-numbered port? */
- if ((pinfo->destport % 2) == 0)
- {
- return FALSE; /* no */
- }
-
/* Look at first byte */
first_byte = tvb_get_guint8(tvb, offset);
@@ -853,6 +847,18 @@ dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
return TRUE;
}
+static gboolean
+dissect_rtcp_heur_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
+{
+ /* Was it sent to an odd-numbered port? */
+ if ((pinfo->destport % 2) == 0)
+ {
+ return FALSE; /* no */
+ }
+
+ return dissect_rtcp_heur(tvb, pinfo, tree, data);
+}
+
/* Dissect the length field. Append to this field text indicating the number of
actual bytes this translates to (i.e. (raw value + 1) * 4) */
static int dissect_rtcp_length_field( proto_tree *tree, tvbuff_t *tvb, int offset)
@@ -6531,7 +6537,7 @@ proto_reg_handoff_rtcp(void)
dissector_add_for_decode_as("udp.port", rtcp_handle);
dissector_add_for_decode_as("flip.payload", rtcp_handle );
- heur_dissector_add( "udp", dissect_rtcp_heur, "RTCP over UDP", "rtcp_udp", proto_rtcp);
+ heur_dissector_add( "udp", dissect_rtcp_heur_udp, "RTCP over UDP", "rtcp_udp", proto_rtcp);
heur_dissector_add("stun", dissect_rtcp_heur, "RTCP over TURN", "rtcp_stun", proto_rtcp);
}