diff options
author | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-02-12 17:30:15 +0000 |
---|---|---|
committer | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-02-12 17:30:15 +0000 |
commit | 63fb6f24841dc744fa38537afbbea7d0d11abbb7 (patch) | |
tree | 8bd4de83f413bbdb54e4e48f8c0ad4eac4e95eaf /epan/dissectors/packet-rtp.c | |
parent | 5b37e16ad8a594339a22c5929502e8a0134b2aec (diff) |
dissect_rtp_heur: prevent a 'false positive' when trying stun dissection.
Specifically: when dissect_rtp_heur calls the stun dissector:
- Don't do a 'data' dissection if stun dissection fails;
(ie: use call_dissector_only instead of call_dissector).
- return the stun dissector success/fail status to the caller of dissect_rtp_heur;
(Done by registering and calling the heuristic version of the stun dissector).
Also: use call_dissector_only for each of the dissectors called by dissect_rtp_heur
(altho it really makes no difference at this point except for the call to the
stun dissector).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27443 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-rtp.c')
-rw-r--r-- | epan/dissectors/packet-rtp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c index 2036a96078..355b6638d3 100644 --- a/epan/dissectors/packet-rtp.c +++ b/epan/dissectors/packet-rtp.c @@ -135,6 +135,7 @@ static const fragment_items rtp_fragment_items = { static dissector_handle_t rtp_handle; static dissector_handle_t stun_handle; +static dissector_handle_t stun_heur_handle; static dissector_handle_t t38_handle; static dissector_handle_t zrtp_handle; @@ -481,16 +482,16 @@ dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) if (version == 0) { if (!(tvb_memeql(tvb, 4, "ZRTP", 4))) { - call_dissector(zrtp_handle, tvb, pinfo, tree); + call_dissector_only(zrtp_handle, tvb, pinfo, tree); return TRUE; } else { switch (global_rtp_version0_type) { case RTP0_STUN: - call_dissector(stun_handle, tvb, pinfo, tree); - return TRUE; + return call_dissector_only(stun_heur_handle, tvb, pinfo, tree); case RTP0_T38: - call_dissector(t38_handle, tvb, pinfo, tree); + /* XXX: Should really be calling a heuristic dissector for T38 ??? */ + call_dissector_only(t38_handle, tvb, pinfo, tree); return TRUE; case RTP0_INVALID: @@ -1951,6 +1952,7 @@ proto_reg_handoff_rtp(void) data_handle = find_dissector("data"); stun_handle = find_dissector("stun"); + stun_heur_handle = find_dissector("stun-heur"); t38_handle = find_dissector("t38"); zrtp_handle = find_dissector("zrtp"); |