summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-09-17 04:09:03 +0200
committerStefan Metzmacher <metze@samba.org>2013-09-17 07:52:29 +0200
commit1d54d8c501afa151b6cc07b98a14caae2b31ec65 (patch)
tree85ff706835650f037f4ad3582f34e024ba8a1cd0 /libcli
parent6ed5b1c159867466e54a54a10adcc6c49a0a7837 (diff)
downloadsamba-1d54d8c501afa151b6cc07b98a14caae2b31ec65.tar.gz
samba-1d54d8c501afa151b6cc07b98a14caae2b31ec65.tar.bz2
samba-1d54d8c501afa151b6cc07b98a14caae2b31ec65.zip
libcli/smb: use SMB1 MID=0 for the initial Negprot
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10144 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/smb/smbXcli_base.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 7176e8f7a3..0fd3d4c2a0 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -737,6 +737,14 @@ static uint16_t smb1cli_alloc_mid(struct smbXcli_conn *conn)
size_t num_pending = talloc_array_length(conn->pending);
uint16_t result;
+ if (conn->protocol == PROTOCOL_NONE) {
+ /*
+ * This is what windows sends on the SMB1 Negprot request
+ * and some vendors reuse the SMB1 MID as SMB2 sequence number.
+ */
+ return 0;
+ }
+
while (true) {
size_t i;