smb2: Lease Epoch is only 16 bit
authorVolker Lendecke <vl@samba.org>
Tue, 28 Jan 2014 10:27:14 +0000 (11:27 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 29 Jan 2014 08:18:07 +0000 (09:18 +0100)
See [MS-SMB2] 2.2.14.2.12

Bug: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9703

Change-Id: Ia9c9c658bd5020e0dad84fc74617fed60ce7df06
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
epan/dissectors/packet-smb2.c

index 6f72fb69bde5e0c5e7472c23c4eb737a03a7e804..137182d000bbf14062cf8d32c761efc7d5211df9 100644 (file)
@@ -228,6 +228,7 @@ static int hf_smb2_lease_flags_break_in_progress = -1;
 static int hf_smb2_lease_duration = -1;
 static int hf_smb2_parent_lease_key = -1;
 static int hf_smb2_lease_epoch = -1;
+static int hf_smb2_lease_reserved = -1;
 static int hf_smb2_lease_break_reason = -1;
 static int hf_smb2_lease_access_mask_hint = -1;
 static int hf_smb2_lease_share_mask_hint = -1;
@@ -5257,7 +5258,8 @@ dissect_smb2_MxAc_buffer_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
  *  4 - lease flags
  *  8 - lease duration
  * 16 - parent lease key
- *  4 - epoch
+ *  2 - epoch
+ *  2 - reserved
  */
 #define SMB2_LEASE_STATE_READ_CACHING   0x00000001
 #define SMB2_LEASE_STATE_HANDLE_CACHING 0x00000002
@@ -5338,7 +5340,10 @@ dissect_SMB2_CREATE_LEASE_VX(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
        proto_tree_add_item(sub_tree, hf_smb2_parent_lease_key, tvb, offset, 16, ENC_LITTLE_ENDIAN);
        offset += 16;
 
-       proto_tree_add_item(sub_tree, hf_smb2_lease_epoch, tvb, offset, 4, ENC_LITTLE_ENDIAN);
+       proto_tree_add_item(sub_tree, hf_smb2_lease_epoch, tvb, offset, 2, ENC_LITTLE_ENDIAN);
+       offset += 2;
+
+       proto_tree_add_item(sub_tree, hf_smb2_lease_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
 }
 
 static void
@@ -7541,7 +7546,11 @@ proto_register_smb2(void)
                    NULL, 0, NULL, HFILL }},
 
                { &hf_smb2_lease_epoch,
-                 { "Lease Epoch", "smb2.lease.lease_oplock", FT_UINT32, BASE_HEX,
+                 { "Lease Epoch", "smb2.lease.lease_oplock", FT_UINT16, BASE_HEX,
+                   NULL, 0, NULL, HFILL }},
+
+               { &hf_smb2_lease_reserved,
+                 { "Lease Reserved", "smb2.lease.lease_reserved", FT_UINT16, BASE_HEX,
                    NULL, 0, NULL, HFILL }},
 
                { &hf_smb2_lease_break_reason,