smbd: Remove a "!" from an if-condition for easier readability
authorVolker Lendecke <vl@samba.org>
Wed, 10 Jan 2018 13:59:08 +0000 (14:59 +0100)
committerStefan Metzmacher <metze@samba.org>
Sun, 14 Jan 2018 09:26:05 +0000 (10:26 +0100)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13215

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/smb2_server.c

index 565f999..69788e9 100644 (file)
@@ -2231,11 +2231,11 @@ static NTSTATUS smbd_smb2_request_dispatch_update_counts(
                cmp *= -1;
        }
 
-       if (!(flags & SMB2_HDR_FLAG_REPLAY_OPERATION)) {
-               if (cmp == 0) {
+       if (flags & SMB2_HDR_FLAG_REPLAY_OPERATION) {
+               if (cmp == 0 && op->pre_request_count == 0) {
                        op->request_count += 1;
                        req->request_counters_updated = true;
-               } else if (cmp > 0) {
+               } else if (cmp > 0 && op->pre_request_count == 0) {
                        op->pre_request_count += op->request_count;
                        op->request_count = 1;
                        op->global->channel_sequence = channel_sequence;
@@ -2245,10 +2245,10 @@ static NTSTATUS smbd_smb2_request_dispatch_update_counts(
                        return NT_STATUS_FILE_NOT_AVAILABLE;
                }
        } else {
-               if (cmp == 0 && op->pre_request_count == 0) {
+               if (cmp == 0) {
                        op->request_count += 1;
                        req->request_counters_updated = true;
-               } else if (cmp > 0 && op->pre_request_count == 0) {
+               } else if (cmp > 0) {
                        op->pre_request_count += op->request_count;
                        op->request_count = 1;
                        op->global->channel_sequence = channel_sequence;