aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dcp-etsi.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-10-09 16:20:54 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-10-09 16:20:54 +0000
commit32bc65aa8cb90c7554e1d41b6a2964e15fb1ce41 (patch)
treee60aafe0037dc65f13be1906b34beecc1aaf6b9c /epan/dissectors/packet-dcp-etsi.c
parent16085e86163164c43823267056624347a0de3a93 (diff)
Try to make more efficient heuristick checks.
svn path=/trunk/; revision=52468
Diffstat (limited to 'epan/dissectors/packet-dcp-etsi.c')
-rw-r--r--epan/dissectors/packet-dcp-etsi.c9
1 files changed, 6 insertions, 3 deletions
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;
}