aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rtp.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2011-09-09 20:37:49 +0000
committerBill Meier <wmeier@newsguy.com>2011-09-09 20:37:49 +0000
commitb3c369619b8dcb41a6deee4c269f0fe99b825e93 (patch)
tree8e1a60ad567d76d884acdd7f1af2ceeb29f59707 /epan/dissectors/packet-rtp.c
parent4a91af2383c56238a18889a51757ef762ce57d16 (diff)
Don't do heuristic check for 'dstport being even' if checking for rtp over stun.
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6322 svn path=/trunk/; revision=38953
Diffstat (limited to 'epan/dissectors/packet-rtp.c')
-rw-r--r--epan/dissectors/packet-rtp.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c
index 55fbaf5486..671784d448 100644
--- a/epan/dissectors/packet-rtp.c
+++ b/epan/dissectors/packet-rtp.c
@@ -676,9 +676,9 @@ void rtp_add_address(packet_info *pinfo,
}
static gboolean
-dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+dissect_rtp_heur_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean check_destport )
{
- guint8 octet1;
+ guint8 octet1;
unsigned int version;
unsigned int offset = 0;
@@ -721,7 +721,7 @@ dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
}
/* Was it sent to an even-numbered port? */
- if ((pinfo->destport % 2) != 0) {
+ if (check_destport && ((pinfo->destport % 2) != 0)) {
return FALSE;
}
@@ -729,6 +729,18 @@ dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
return TRUE;
}
+static gboolean
+dissect_rtp_heur_udp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+{
+ return dissect_rtp_heur_common(tvb, pinfo, tree, TRUE);
+}
+
+static gboolean
+dissect_rtp_heur_stun( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+{
+ return dissect_rtp_heur_common(tvb, pinfo, tree, FALSE);
+}
+
/*
* Process the payload of the RTP packet, hand it to the subdissector
*/
@@ -2169,8 +2181,8 @@ proto_reg_handoff_rtp(void)
dissector_add_handle("udp.port", rtp_handle); /* for 'decode-as' */
dissector_add_string("rtp_dyn_payload_type", "red", rtp_rfc2198_handle);
- heur_dissector_add( "udp", dissect_rtp_heur, proto_rtp);
- heur_dissector_add("stun", dissect_rtp_heur, proto_rtp);
+ heur_dissector_add( "udp", dissect_rtp_heur_udp, proto_rtp);
+ heur_dissector_add("stun", dissect_rtp_heur_stun, proto_rtp);
data_handle = find_dissector("data");
classicstun_handle = find_dissector("classicstun");