HACK debug replay/channel_sequence
authorStefan Metzmacher <metze@samba.org>
Thu, 26 Jul 2012 06:22:01 +0000 (08:22 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 13 Aug 2018 15:34:29 +0000 (17:34 +0200)
source3/smbd/smb2_server.c

index 229f8ab0e856beb86cdf3e5c32a608bb467919ac..17b9f7f3db1a926f7a451bbaa6a14a355cb60e53 100644 (file)
@@ -777,6 +777,9 @@ static NTSTATUS smbd_smb2_request_validate(struct smbd_smb2_request *req)
                struct iovec *hdr = SMBD_SMB2_IDX_HDR_IOV(req,in,idx);
                struct iovec *body = SMBD_SMB2_IDX_BODY_IOV(req,in,idx);
                const uint8_t *inhdr = NULL;
+               uint16_t channel_sequence;
+               uint32_t flags;
+               bool replay = false;
 
                if (hdr->iov_len != SMB2_HDR_BODY) {
                        return NT_STATUS_INVALID_PARAMETER;
@@ -796,6 +799,17 @@ static NTSTATUS smbd_smb2_request_validate(struct smbd_smb2_request *req)
                if (!smb2_validate_message_id(req->xconn, inhdr)) {
                        return NT_STATUS_INVALID_PARAMETER;
                }
+
+               channel_sequence = SVAL(inhdr, SMB2_HDR_CHANNEL_SEQUENCE);
+               flags = IVAL(inhdr, SMB2_HDR_FLAGS);
+               if (flags & SMB2_HDR_FLAG_REPLAY_OPERATION) {
+                       replay = true;
+               }
+
+               if (channel_sequence != 0 || replay) {
+                       DEBUG(0,("REPLAY[%d] CHANNEL_SEQUENCE[%u]\n",
+                                replay, channel_sequence));
+               }
        }
 
        return NT_STATUS_OK;