aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-artnet.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-10-14 18:16:11 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-10-14 18:16:11 +0000
commit7541b470206726239051a0453ceeb377d80cb19d (patch)
tree45af85591d3e4a790539224470fddbe28f6ed6ec /epan/dissectors/packet-artnet.c
parentc94403e9ba67eae9c04a033957d78533fed254b5 (diff)
Try to pptimize heuristics slightly.
svn path=/trunk/; revision=52603
Diffstat (limited to 'epan/dissectors/packet-artnet.c')
-rw-r--r--epan/dissectors/packet-artnet.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/epan/dissectors/packet-artnet.c b/epan/dissectors/packet-artnet.c
index f5d44ad449..71ea5d053b 100644
--- a/epan/dissectors/packet-artnet.c
+++ b/epan/dissectors/packet-artnet.c
@@ -3133,14 +3133,15 @@ dissect_artnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
static gboolean
dissect_artnet_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- static const char artnet_packet_id[] = "Art-Net\0";
+ guint64 qword;
/* check if we atleast have the 8 byte header */
- if (tvb_length(tvb) < sizeof(artnet_packet_id))
+ if (tvb_length(tvb) < 8)
return FALSE;
- /* Check the 8 byte header */
- if (tvb_memeql(tvb, 0, artnet_packet_id, sizeof(artnet_packet_id) - 1) != 0)
+ /* Check the 8 byte header "Art-Net\0" = 0x4172742d4e7400*/
+ qword = tvb_get_ntoh64(tvb,0);
+ if(qword != G_GINT64_CONSTANT (0x4172742d4e7400U))
return FALSE;
/* if the header matches, dissect it */