diff options
author | Andreas Gruenbacher <andreas.gruenbacher@gmail.com> | 2015-05-19 11:43:06 +0200 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-05-22 14:06:13 +0000 |
commit | 78593c2e91e7c69ad9eb9a16f5508e704e4035e5 (patch) | |
tree | eac970cda66b56b4625bd784c7c2e5e747d3c3f0 /epan | |
parent | 03577f6ba4043016f8dbdfa60ca5c5b29ea5cba7 (diff) |
NFS: Fix NFSv4 attribute offsets and lengths
NFSv4 attributes are transferred as a bitmask, followed by each of the
attributes in the bitmask. The offset and length of the dissected attribute
values should point at where the attribute values are; instead, they were
pointing at the bitmap. Fix that.
Change-Id: I4f93b7fffd7497306ae828a2fbd3c0e9b0accd1c
Reviewed-on: https://code.wireshark.org/review/8536
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-nfs.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index 289f46e153..2bbc954f26 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -6742,11 +6742,16 @@ dissect_nfs4_fattrs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t /* Display label: reqd_attr: or reco_attr: */ attr_item = proto_tree_add_uint(bitmap_tree, - ((attr_num <= 11 || attr_num == 19 || attr_num == 75) ? hf_nfs4_reqd_attr: hf_nfs4_reco_attr), - tvb, attr_mask_offset, 4, attr_num); + (attr_num <= FATTR4_RDATTR_ERROR || + attr_num == FATTR4_FILEHANDLE || + attr_num == FATTR4_SUPPATTR_EXCLCREAT) ? + hf_nfs4_reqd_attr: hf_nfs4_reco_attr, + tvb, offset, 0, attr_num); } if (type == FATTR4_DISSECT_VALUES) { + int attr_offset = offset; + /* Decode the value of this attribute */ if (attr_item) attr_tree = proto_item_add_subtree(attr_item, ett_nfs4_bitmap); @@ -6994,6 +6999,9 @@ dissect_nfs4_fattrs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t default: break; } + + if (attr_item) + proto_item_set_len(attr_item, offset - attr_offset); } } sl <<= 1; |