aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-waveagent.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-09-20 14:06:43 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-09-20 14:06:43 +0000
commit067ca19a47b7c14638987ea318476cb5265308c7 (patch)
tree9c2474e66ae62052b12742a7226c46337fb1dc8e /epan/dissectors/packet-waveagent.c
parent9c5ff393aae51ffc190f55111d8961082b8a3118 (diff)
Try to make heuristic slightly faster.
svn path=/trunk/; revision=52153
Diffstat (limited to 'epan/dissectors/packet-waveagent.c')
-rw-r--r--epan/dissectors/packet-waveagent.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/epan/dissectors/packet-waveagent.c b/epan/dissectors/packet-waveagent.c
index 3da9593575..33f9af3153 100644
--- a/epan/dissectors/packet-waveagent.c
+++ b/epan/dissectors/packet-waveagent.c
@@ -1010,19 +1010,24 @@ static int dissect_waveagent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (tvb_length(tvb) < 52 )
return 0;
- signature_start = tvb_get_guint8(tvb, 0);
- signature_end = tvb_get_guint8(tvb, 15);
- version = ((tvb_get_ntohl(tvb, 16) & 0xF0000000) >> 28 == 1) ? 3 : 2; /* Mask version bit off */
magic_number = tvb_get_ntohl(tvb, 16) & 0x0FFFFFFF; /* Mask magic number off */
+ if(magic_number != 0x0F87C3A5){
+ return 0;
+ }
+
+ signature_start = tvb_get_guint8(tvb, 0);
+ signature_end = tvb_get_guint8(tvb, 15);
if ( ((signature_start != 0xcc) && (signature_start !=0xdd)) ||
- (signature_end != 0xE2) || (magic_number != 0x0F87C3A5) )
+ (signature_end != 0xE2))
/* This packet does not appear to belong to WaveAgent.
* Return 0 to give another dissector a chance to dissect it.
*/
return 0;
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "WA");
+ version = ((tvb_get_ntohl(tvb, 16) & 0xF0000000) >> 28 == 1) ? 3 : 2; /* Mask version bit off */
+
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "WA");
col_clear(pinfo->cinfo, COL_INFO);
/* Grab the control word, parse the WaveAgent payload accordingly */