diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-08-14 08:12:08 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2013-08-30 11:53:22 +0200 |
commit | 801bcd084f3f3ed91668d95e9c1228e16b0b5691 (patch) | |
tree | b285c3bd035191987a45ff75ce8655bd1a1b05ba /libcli/smb | |
parent | d9f3bd248940263e6a108cfcc61a3adeb3e7de6b (diff) | |
download | samba-801bcd084f3f3ed91668d95e9c1228e16b0b5691.tar.gz |
libcli/smb: fix the credit handling on a SMB1 => SMB2 negotiate
Our cur_credit value had 1 credit too many in the case of
an SMB1 => SMB2 upgrade. When we max out the credits the server
disconnected the connection.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 97288b7f1048c1bf712463293a1e62737738292c)
Diffstat (limited to 'libcli/smb')
-rw-r--r-- | libcli/smb/smbXcli_base.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index 5a5828acc76..b950900ce9e 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -4404,9 +4404,14 @@ static NTSTATUS smbXcli_negprot_dispatch_incoming(struct smbXcli_conn *conn, /* * we got an SMB2 answer, which consumed sequence number 0 - * so we need to use 1 as the next one + * so we need to use 1 as the next one. + * + * we also need to set the current credits to 0 + * as we consumed the initial one. The SMB2 answer + * hopefully grant us a new credit. */ conn->smb2.mid = 1; + conn->smb2.cur_credits = 0; tevent_req_set_callback(subreq, smbXcli_negprot_smb2_done, req); conn->dispatch_incoming = smb2cli_conn_dispatch_incoming; return smb2cli_conn_dispatch_incoming(conn, tmp_mem, inbuf); |