s3:smb2_server: pass smbXsrv_connection to smbd_smb2_send_break()
authorStefan Metzmacher <metze@samba.org>
Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 6 Aug 2014 07:51:14 +0000 (09:51 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/smbd/smb2_server.c

index 984d4406aa2d7b5c9132653be2d75ca25aaafe27..497c5dc6bfaad0e1106abb8ec227464ee5b62f2a 100644 (file)
@@ -2734,14 +2734,13 @@ struct smbd_smb2_send_break_state {
        uint8_t body[1];
 };
 
-static NTSTATUS smbd_smb2_send_break(struct smbd_server_connection *sconn,
+static NTSTATUS smbd_smb2_send_break(struct smbXsrv_connection *xconn,
                                     struct smbXsrv_session *session,
                                     struct smbXsrv_tcon *tcon,
                                     const uint8_t *body,
                                     size_t body_len)
 {
        struct smbd_smb2_send_break_state *state;
-       struct smbXsrv_connection *xconn = sconn->conn;
        bool do_encryption = session->global->encryption_required;
        uint64_t nonce_high = 0;
        uint64_t nonce_low = 0;
@@ -2755,7 +2754,7 @@ static NTSTATUS smbd_smb2_send_break(struct smbd_server_connection *sconn,
        statelen = offsetof(struct smbd_smb2_send_break_state, body) +
                body_len;
 
-       state = talloc_zero_size(sconn, statelen);
+       state = talloc_zero_size(xconn, statelen);
        if (state == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -2858,6 +2857,7 @@ NTSTATUS smbd_smb2_send_oplock_break(struct smbd_server_connection *sconn,
                                     struct smbXsrv_open *op,
                                     uint8_t oplock_level)
 {
+       struct smbXsrv_connection *xconn = sconn->conn;
        uint8_t body[0x18];
 
        SSVAL(body, 0x00, sizeof(body));
@@ -2867,7 +2867,7 @@ NTSTATUS smbd_smb2_send_oplock_break(struct smbd_server_connection *sconn,
        SBVAL(body, 0x08, op->global->open_persistent_id);
        SBVAL(body, 0x10, op->global->open_volatile_id);
 
-       return smbd_smb2_send_break(sconn, session, tcon, body, sizeof(body));
+       return smbd_smb2_send_break(xconn, session, tcon, body, sizeof(body));
 }
 
 static bool is_smb2_recvfile_write(struct smbd_smb2_request_read_state *state)