diff options
author | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-09-09 20:37:49 +0000 |
---|---|---|
committer | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-09-09 20:37:49 +0000 |
commit | 4f339760f3735bd75576157edcba52fafe0a299b (patch) | |
tree | 8e1a60ad567d76d884acdd7f1af2ceeb29f59707 /epan/dissectors/packet-rtp.c | |
parent | b55a98fa82ec69c2a4c0807616cf246cec39a015 (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
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38953 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-rtp.c')
-rw-r--r-- | epan/dissectors/packet-rtp.c | 22 |
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"); |