diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-09-24 19:57:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-09-24 19:57:41 +0000 |
commit | 84ac86916b03c8daa085597b8f9d468153004533 (patch) | |
tree | a70f717831b9095f0c9ff4a693b5acea700047f2 /plugins | |
parent | ff7b1d8a65c6de364fd6ffe4f9c29d90db696039 (diff) |
Stuff used when checking the CRC needs to be done regardless of whether
we're building a protocol tree or not.
svn path=/trunk/; revision=52207
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/wimax/mac_hd_generic_decoder.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/plugins/wimax/mac_hd_generic_decoder.c b/plugins/wimax/mac_hd_generic_decoder.c index 5cf1914715..f054de2b3e 100644 --- a/plugins/wimax/mac_hd_generic_decoder.c +++ b/plugins/wimax/mac_hd_generic_decoder.c @@ -736,19 +736,22 @@ static void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "GMH"); #endif - if (tree) - { /* we are being asked for details */ - /* Get the frame length */ - tvb_len = tvb_reported_length(tvb); - if (tvb_len < WIMAX_MAC_HEADER_SIZE) - { /* display the error message */ + /* Get the frame length */ + tvb_len = tvb_reported_length(tvb); + if (tvb_len < WIMAX_MAC_HEADER_SIZE) + { + if (tree) { + /* display the error message */ generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, tvb_len, "Error: the size of Generic MAC Header tvb is too small! (%u bytes)", tvb_len); /* add subtree */ generic_tree = proto_item_add_subtree(generic_item, ett_mac_header_generic_decoder); /* display the Generic MAC Header in Hex */ proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, tvb, offset, tvb_len, ENC_NA); - return; } + return; + } + if (tree) + { /* we are being asked for details */ /* get the parent */ parent_item = proto_tree_get_parent(tree); /* add the MAC header info */ @@ -779,8 +782,10 @@ static void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo mac_ci = ((ubyte & WIMAX_MAC_HEADER_GENERIC_CI_MASK)?1:0); /* get the Encryption key sequence (EKS) */ /*mac_eks = ((ubyte & WIMAX_MAC_HEADER_GENERIC_EKS_MASK)>>4); XX: not used ?? */ - /* get the MAC length */ - mac_len = (tvb_get_ntohs(tvb, (offset+1)) & WIMAX_MAC_HEADER_GENERIC_LEN); + } + /* get the MAC length; this is used even if tree is null */ + mac_len = (tvb_get_ntohs(tvb, (offset+1)) & WIMAX_MAC_HEADER_GENERIC_LEN); + if (tree) { /* get the CID */ mac_cid = tvb_get_ntohs(tvb, (offset+3)); /* display the Header Type (HT) */ |