diff options
author | Jeremy Allison <jra@samba.org> | 2010-04-12 21:40:28 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2010-04-12 21:40:28 -0700 |
commit | 79842437684be380407661fc27e64f223a326b18 (patch) | |
tree | 867b994fdc97991637d5b33fa57ba77b214c9cca /source3/smbd/smb2_glue.c | |
parent | 8a2169d6749498c7929e7533f6b3c9d965b0aa3b (diff) | |
download | samba-79842437684be380407661fc27e64f223a326b18.tar.gz samba-79842437684be380407661fc27e64f223a326b18.tar.xz samba-79842437684be380407661fc27e64f223a326b18.zip |
Move to using 64-bit mid values in our internal open file database.
This will allow us to share logic much easier between SMB1 and SMB2
servers.
Jeremy
Diffstat (limited to 'source3/smbd/smb2_glue.c')
-rw-r--r-- | source3/smbd/smb2_glue.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/source3/smbd/smb2_glue.c b/source3/smbd/smb2_glue.c index ac31ce54f03..26107df389f 100644 --- a/source3/smbd/smb2_glue.c +++ b/source3/smbd/smb2_glue.c @@ -22,18 +22,6 @@ #include "smbd/globals.h" #include "../libcli/smb/smb_common.h" -static uint16_t allocate_next_mid(void) -{ - struct smbd_server_connection *sconn = smbd_server_conn; - - sconn->smb2.next_compat_mid++; - /* Avoid mid == 0 and mid == 0xffff. */ - if (sconn->smb2.next_compat_mid == 0xFFFF) { - sconn->smb2.next_compat_mid += 2; - } - return sconn->smb2.next_compat_mid; -} - struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req) { struct smb_request *smbreq; @@ -58,7 +46,7 @@ struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req) if (IVAL(inhdr, SMB2_HDR_FLAGS) & SMB2_HDR_FLAG_DFS) { smbreq->flags2 |= FLAGS2_DFS_PATHNAMES; } - req->compat_mid = smbreq->mid = allocate_next_mid(); + smbreq->mid = BVAL(inhdr, SMB2_HDR_MESSAGE_ID); smbreq->chain_fsp = req->compat_chain_fsp; smbreq->smb2req = req; @@ -68,20 +56,20 @@ struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req) /* Dummy functions for the SMB1 -> SMB2 deferred open message * hooks. */ -void remove_deferred_open_message_smb2(uint16_t mid) +void remove_deferred_open_message_smb2(uint64_t mid) { } -void schedule_deferred_open_message_smb2(uint16_t mid) +void schedule_deferred_open_message_smb2(uint64_t mid) { } -bool open_was_deferred_smb2(uint16_t mid) +bool open_was_deferred_smb2(uint64_t mid) { return false; } -bool get_deferred_open_message_state_smb2(uint16_t mid, +bool get_deferred_open_message_state_smb2(uint64_t mid, struct timeval *p_request_time, void **pp_state) { |