STEP12? HACK debug replay/channel_sequence
authorStefan Metzmacher <metze@samba.org>
Thu, 26 Jul 2012 06:22:01 +0000 (08:22 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 4 Sep 2015 16:02:42 +0000 (18:02 +0200)
source3/smbd/smb2_server.c

index 391e99798a812277f1a3042b52fc50de6328ac4d..a402355cec2100362b58f0fb2755d617ac331f6e 100644 (file)
@@ -752,6 +752,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;
@@ -771,6 +774,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;