HACK debug replay/channel_sequence
[metze/samba/wip.git] / source3 / smbd / smb2_server.c
index 5a98a2e82d4d4e21b9f07ed4d28f966dffe15621..f1bc93f9b71df2318cf15be57322d2fb5fc9d48c 100644 (file)
@@ -792,6 +792,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;
@@ -811,6 +814,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;