Fix the "allow_smb2" bug being set to false that was driving me mad :-).
authorJeremy Allison <jra@samba.org>
Wed, 28 Apr 2010 05:15:17 +0000 (22:15 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 28 Apr 2010 05:15:17 +0000 (22:15 -0700)
The first packet from a rebooted Win7 on an SMB2 connection is an SMB1
negprot...

Jeremy.

source3/smbd/process.c

index 1ba1db5c5d460cee52ad619b25fa2f81ddc49ec6..53c5e0b4089665f68385bd43cbbd2ea51e75da2c 100644 (file)
@@ -1633,8 +1633,12 @@ static void process_smb(struct smbd_server_connection *conn,
                if (smbd_is_smb2_header(inbuf, nread)) {
                        smbd_smb2_first_negprot(smbd_server_conn, inbuf, nread);
                        return;
+               } else if (nread >= smb_size && valid_smb_header(inbuf)
+                               && CVAL(inbuf, smb_com) != 0x72) {
+                       /* This is a non-negprot SMB1 packet.
+                          Disable SMB2 from now on. */
+                       smbd_server_conn->allow_smb2 = false;
                }
-               smbd_server_conn->allow_smb2 = false;
        }
 
        show_msg((char *)inbuf);