smb3: send CAP_DFS capability during session setup
authorSteve French <stfrench@microsoft.com>
Thu, 25 Jul 2019 23:13:10 +0000 (18:13 -0500)
committerSteve French <stfrench@microsoft.com>
Tue, 6 Aug 2019 03:50:38 +0000 (22:50 -0500)
We had a report of a server which did not do a DFS referral
because the session setup Capabilities field was set to 0
(unlike negotiate protocol where we set CAP_DFS).  Better to
send it session setup in the capabilities as well (this also
more closely matches Windows client behavior).

Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
CC: Stable <stable@vger.kernel.org>
fs/cifs/smb2pdu.c

index 33efc5fb293c8b4625bcf427d751f86ca3611f03..31e4a1b0b1704b90e9ed8f0cdb123477933fb369 100644 (file)
@@ -1196,7 +1196,12 @@ SMB2_sess_alloc_buffer(struct SMB2_sess_data *sess_data)
        else
                req->SecurityMode = 0;
 
+#ifdef CONFIG_CIFS_DFS_UPCALL
+       req->Capabilities = cpu_to_le32(SMB2_GLOBAL_CAP_DFS);
+#else
        req->Capabilities = 0;
+#endif /* DFS_UPCALL */
+
        req->Channel = 0; /* MBZ */
 
        sess_data->iov[0].iov_base = (char *)req;