aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pana.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-pana.c
parent16085e86163164c43823267056624347a0de3a93 (diff)
Try to make more efficient heuristick checks.
svn path=/trunk/; revision=52468
Diffstat (limited to 'epan/dissectors/packet-pana.c')
-rw-r--r--epan/dissectors/packet-pana.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/epan/dissectors/packet-pana.c b/epan/dissectors/packet-pana.c
index d759df60cb..f07e39a29d 100644
--- a/epan/dissectors/packet-pana.c
+++ b/epan/dissectors/packet-pana.c
@@ -668,13 +668,8 @@ dissect_pana(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
return 0;
}
- /* Get header fields */
- pana_res = tvb_get_ntohs(tvb, 0);
+ /* Check minimum packet length */
msg_length = tvb_get_ntohs(tvb, 2);
- flags = tvb_get_ntohs(tvb, 4);
- msg_type = tvb_get_ntohs(tvb, 6);
-
- /* Check minimum packet length */
if(msg_length < 16) {
return 0;
}
@@ -685,16 +680,19 @@ dissect_pana(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
/* check that the reserved field is zero */
+ pana_res = tvb_get_ntohs(tvb, 0);
if (pana_res != 0) {
return 0;
}
/* verify that none of the reserved bits are set */
+ flags = tvb_get_ntohs(tvb, 4);
if (flags & PANA_FLAG_RESERVED) {
return 0;
}
/* verify that we recognize the message type */
+ msg_type = tvb_get_ntohs(tvb, 6);
if ((msg_type > MSG_TYPE_MAX) || (msg_type == 0)) {
return 0;
}