s3:smbd: SMB2 session ids are 64bit...
authorStefan Metzmacher <metze@samba.org>
Fri, 22 May 2009 09:06:54 +0000 (11:06 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 22 May 2009 12:03:13 +0000 (14:03 +0200)
We only grand ids up to 0x0000000000FFFFFF,
because that's what our idtree implementation can handle.
But also 16777215 sessions on one tcp connection should be enough:-)

metze

source3/smbd/smb2_server.c
source3/smbd/smb2_sesssetup.c

index 83ce7c4358740c1bdec75f3587124f0df19c681f..c6160189fe2057bae6ed08e5a31f9641ac3dafe9 100644 (file)
@@ -59,7 +59,7 @@ static NTSTATUS smbd_initialize_smb2(struct smbd_server_connection *conn)
        if (conn->smb2.sessions.idtree == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
-       conn->smb2.sessions.limit = 0x0000FFFF;
+       conn->smb2.sessions.limit = 0x00FFFFFF;
        conn->smb2.sessions.list = NULL;
 
        ret = tstream_bsd_existing_socket(conn, smbd_server_fd(),
index 50476bfbe5f975c642e46dc782837c5397f16dce..a7fef4ab2fc8b320293247acd364aedd354e5230 100644 (file)
@@ -71,7 +71,7 @@ NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
        }
 
-       in_session_id = SVAL(inhdr, SMB2_HDR_SESSION_ID);
+       in_session_id = BVAL(inhdr, SMB2_HDR_SESSION_ID);
        in_security_buffer.data = (uint8_t *)req->in.vector[i+2].iov_base;
        in_security_buffer.length = in_security_length;
 
@@ -207,7 +207,7 @@ NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req)
 
        inhdr = (const uint8_t *)req->in.vector[i+0].iov_base;
 
-       in_session_id = SVAL(inhdr, SMB2_HDR_SESSION_ID);
+       in_session_id = BVAL(inhdr, SMB2_HDR_SESSION_ID);
 
        /* lookup an existing session */
        p = idr_find(req->conn->smb2.sessions.idtree, in_session_id);