diff options
author | Anders Broman <anders.broman@ericsson.com> | 2013-10-09 16:20:54 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2013-10-09 16:20:54 +0000 |
commit | 32bc65aa8cb90c7554e1d41b6a2964e15fb1ce41 (patch) | |
tree | e60aafe0037dc65f13be1906b34beecc1aaf6b9c /epan/dissectors/packet-ar_drone.c | |
parent | 16085e86163164c43823267056624347a0de3a93 (diff) |
Try to make more efficient heuristick checks.
svn path=/trunk/; revision=52468
Diffstat (limited to 'epan/dissectors/packet-ar_drone.c')
-rw-r--r-- | epan/dissectors/packet-ar_drone.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/epan/dissectors/packet-ar_drone.c b/epan/dissectors/packet-ar_drone.c index 8c788b56d8..4ecaa9cd18 100644 --- a/epan/dissectors/packet-ar_drone.c +++ b/epan/dissectors/packet-ar_drone.c @@ -124,12 +124,16 @@ dissect_ar_drone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data proto_item *ti, *sub_item; proto_tree *ar_tree, *sub_tree; char *command; + guint32 dword; if (tvb_length(tvb) < 4) return 0; - /* Make sure the packet we're dissecting is a ar_drone packet */ - if(strcmp(tvb_get_string(wmem_packet_scope(),tvb,0,3),"AT*")) + /* Make sure the packet we're dissecting is a ar_drone packet + * Cheap string check for 'AT*' + */ + dword = tvb_get_ntoh24(tvb,0); + if(dword != 0x41542a) return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "ar_drone"); |