s3:smb2_server: move sconn->smb2.negprot_2ff to xconn->smb2.allow_2ff
authorStefan Metzmacher <metze@samba.org>
Fri, 23 May 2014 08:07:21 +0000 (10:07 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 6 Aug 2014 07:51:11 +0000 (09:51 +0200)
This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/smbd/globals.h
source3/smbd/smb2_negprot.c

index fb27649880d12941a4aa80e474cbdbc26de6ed59..3dd03978f4fd9b1e6d4cfa88a76d2373a62be865 100644 (file)
@@ -434,6 +434,7 @@ struct smbXsrv_connection {
                struct smbd_smb2_send_queue *send_queue;
                size_t send_queue_len;
 
+               bool allow_2ff;
                struct {
                        uint32_t capabilities;
                        struct GUID guid;
@@ -789,7 +790,6 @@ struct smbd_server_connection {
                } locks;
        } smb1;
        struct {
-               bool negprot_2ff;
                struct {
                        /* The event that makes us process our blocking lock queue */
                        struct tevent_timer *brl_timeout;
index deeb19dedf0065eeff40e56615fbbbc9197a95e4..c7d88d94c2b1021d7a57f043b895b937c946bf4d 100644 (file)
@@ -78,7 +78,8 @@ void reply_smb2002(struct smb_request *req, uint16_t choice)
  */
 void reply_smb20ff(struct smb_request *req, uint16_t choice)
 {
-       req->sconn->smb2.negprot_2ff = true;
+       struct smbXsrv_connection *xconn = req->sconn->conn;
+       xconn->smb2.allow_2ff = true;
        reply_smb20xx(req, SMB2_DIALECT_REVISION_2FF);
 }
 
@@ -169,6 +170,7 @@ enum protocol_types smbd_smb2_protocol_dialect_match(const uint8_t *indyn,
 
 NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
 {
+       struct smbXsrv_connection *xconn = req->sconn->conn;
        NTSTATUS status;
        const uint8_t *inbody;
        const uint8_t *indyn = NULL;
@@ -234,8 +236,8 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
 
                dialect = SVAL(indyn, c*2);
                if (dialect == SMB2_DIALECT_REVISION_2FF) {
-                       if (req->sconn->smb2.negprot_2ff) {
-                               req->sconn->smb2.negprot_2ff = false;
+                       if (xconn->smb2.allow_2ff) {
+                               xconn->smb2.allow_2ff = false;
                                protocol = PROTOCOL_SMB2_10;
                                break;
                        }