summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-12-13 13:34:50 -0800
committerJeremy Allison <jra@samba.org>2010-12-13 13:34:50 -0800
commit6ce365b238755ccd64b1c2aca0933f8e717300b0 (patch)
treebac418ad7bfff311cfab905f57ced579c2a3693b /source3/smbd
parent27a47eb9fc869a1ee6c18f4165e1dccc9a8bee26 (diff)
downloadsamba-6ce365b238755ccd64b1c2aca0933f8e717300b0.tar.gz
samba-6ce365b238755ccd64b1c2aca0933f8e717300b0.tar.bz2
samba-6ce365b238755ccd64b1c2aca0933f8e717300b0.zip
We need to start off with smb2.credits_granted == 0. That way
when processing the faked up SMB2 NegProt from the SMB1 packet we always allocate one credit on reply. Jeremy.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/smb2_server.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index d2baed7cb4..91e00dc050 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -111,7 +111,7 @@ static NTSTATUS smbd_initialize_smb2(struct smbd_server_connection *sconn)
sconn->smb2.sessions.limit = 0x0000FFFE;
sconn->smb2.sessions.list = NULL;
sconn->smb2.seqnum_low = 0;
- sconn->smb2.credits_granted = 1;
+ sconn->smb2.credits_granted = 0;
sconn->smb2.max_credits = lp_smb2_max_credits();
sconn->smb2.credits_bitmap = bitmap_talloc(sconn, 2*sconn->smb2.max_credits);
if (sconn->smb2.credits_bitmap == NULL) {
@@ -453,7 +453,8 @@ static void smb2_set_operation_credit(struct smbd_server_connection *sconn,
sconn->smb2.credits_granted));
if (credits_granted == 0 && sconn->smb2.credits_granted == 0) {
- /* Ensure the client credits can never drop to zero. */
+ /* First negprot packet, or ensure the client credits can
+ never drop to zero. */
credits_granted = 1;
}