s3:smbd: add expected_seq_low arg to smbd_initialize_smb2
authorRalph Boehme <slow@samba.org>
Sat, 26 Sep 2015 23:58:46 +0000 (01:58 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 6 Oct 2015 19:53:19 +0000 (21:53 +0200)
This is in preparation of connection passing for multichannel where we
have to set seq_low to the mid of the passed negprot.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/smbd/smb2_server.c

index a53ddf8527d81fa8aaa79e0a43eeca1a1a25fdc5..2c1546c5077c0d2a8c76c62d09565cb7d6f4789d 100644 (file)
@@ -200,11 +200,12 @@ bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size)
        return true;
 }
 
-static NTSTATUS smbd_initialize_smb2(struct smbXsrv_connection *xconn)
+static NTSTATUS smbd_initialize_smb2(struct smbXsrv_connection *xconn,
+                                    uint64_t expected_seq_low)
 {
        TALLOC_FREE(xconn->transport.fde);
 
-       xconn->smb2.credits.seq_low = 0;
+       xconn->smb2.credits.seq_low = expected_seq_low;
        xconn->smb2.credits.seq_range = 1;
        xconn->smb2.credits.granted = 1;
        xconn->smb2.credits.max = lp_smb2_max_credits();
@@ -3159,7 +3160,7 @@ void smbd_smb2_first_negprot(struct smbXsrv_connection *xconn,
        DEBUG(10,("smbd_smb2_first_negprot: packet length %u\n",
                 (unsigned int)size));
 
-       status = smbd_initialize_smb2(xconn);
+       status = smbd_initialize_smb2(xconn, 0);
        if (!NT_STATUS_IS_OK(status)) {
                smbd_server_connection_terminate(xconn, nt_errstr(status));
                return;