]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Add utility function smbd_smb2_is_last_in_compound().
authorJeremy Allison <jra@samba.org>
Thu, 20 Oct 2022 22:08:14 +0000 (15:08 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 17 Nov 2022 04:58:28 +0000 (04:58 +0000)
Not yet used. Returns true if we're processing the last SMB2 request in a
compound.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15172

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/globals.h
source3/smbd/smb2_server.c

index efcf02f0d2471d45dda8d8355d5f80a7e9ef324e..125ef64f070533a100ee152f9ff7ec79d38028b9 100644 (file)
@@ -238,6 +238,7 @@ void smbd_server_disconnect_client_ex(struct smbXsrv_client *client,
 const char *smb2_opcode_name(uint16_t opcode);
 bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size);
 bool smbd_smb2_is_compound(const struct smbd_smb2_request *req);
+bool smbd_smb2_is_last_in_compound(const struct smbd_smb2_request *req);
 
 NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd,
                             NTTIME now, struct smbXsrv_connection **_xconn);
index 1cd5953f116d65ec997562ce82a645afb5d2542b..8e32a477947cf8f9a0d885589fceb8c4e1a55109 100644 (file)
@@ -229,6 +229,12 @@ bool smbd_smb2_is_compound(const struct smbd_smb2_request *req)
        return req->in.vector_count >= (2*SMBD_SMB2_NUM_IOV_PER_REQ);
 }
 
+bool smbd_smb2_is_last_in_compound(const struct smbd_smb2_request *req)
+{
+       return (req->current_idx + SMBD_SMB2_NUM_IOV_PER_REQ ==
+               req->in.vector_count);
+}
+
 static NTSTATUS smbd_initialize_smb2(struct smbXsrv_connection *xconn,
                                     uint64_t expected_seq_low)
 {