From 32bc65aa8cb90c7554e1d41b6a2964e15fb1ce41 Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Wed, 9 Oct 2013 16:20:54 +0000 Subject: Try to make more efficient heuristick checks. svn path=/trunk/; revision=52468 --- epan/dissectors/packet-dcp-etsi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'epan/dissectors/packet-dcp-etsi.c') diff --git a/epan/dissectors/packet-dcp-etsi.c b/epan/dissectors/packet-dcp-etsi.c index e2a3369fe5..dc8e4b176e 100644 --- a/epan/dissectors/packet-dcp-etsi.c +++ b/epan/dissectors/packet-dcp-etsi.c @@ -148,6 +148,7 @@ dissect_dcp_etsi (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * { guint8 *sync; proto_tree *dcp_tree = NULL; + guint16 word; /* 6.1 AF packet structure * @@ -179,9 +180,10 @@ dissect_dcp_etsi (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * if(tvb_length(tvb) < 11) return FALSE; - sync = tvb_get_string (wmem_packet_scope(), tvb, 0, 2); - if((sync[0]!='A' && sync[0]!='P') || sync[1]!='F') - return FALSE; + word = tvb_get_ntohs(tvb,0); + /* Check for 'AF or 'PF' */ + if(word != 0x4146 && word != 0x5046) + return FALSE; pinfo->current_proto = "DCP (ETSI)"; @@ -196,6 +198,7 @@ dissect_dcp_etsi (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * dcp_tree = proto_item_add_subtree (ti, ett_edcp); } + sync = tvb_get_string (wmem_packet_scope(), tvb, 0, 2); dissector_try_string(dcp_dissector_table, (char*)sync, tvb, pinfo, dcp_tree); return TRUE; } -- cgit v1.2.3