libcli/smb: use SMB1 MID=0 for the initial Negprot
authorStefan Metzmacher <metze@samba.org>
Tue, 17 Sep 2013 02:09:03 +0000 (04:09 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 17 Sep 2013 05:52:29 +0000 (07:52 +0200)
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>
libcli/smb/smbXcli_base.c

index 7176e8f7a3c04a41c5c1f2b524864d08f69fd834..0fd3d4c2a034efa3a0aa9976dbd34162a5f7542c 100644 (file)
@@ -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;