summaryrefslogtreecommitdiffstats
path: root/fs/cifs/sess.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2011-04-29 05:40:20 +0000
committerSteve French <sfrench@us.ibm.com>2011-05-19 14:10:51 +0000
commitbe8e3b0044a68e1f1002c432f6b40d290cf0701d (patch)
tree41f6a5e2ccf4bf03eb722030563490bbe46f0644 /fs/cifs/sess.c
parent9409ae58e0759d010b347e7b19ebc90ab5d4b98f (diff)
downloadlinux-be8e3b0044a68e1f1002c432f6b40d290cf0701d.tar.gz
linux-be8e3b0044a68e1f1002c432f6b40d290cf0701d.tar.bz2
linux-be8e3b0044a68e1f1002c432f6b40d290cf0701d.zip
consistently use smb_buf_length as be32 for cifs (try 3)
There is one big endian field in the cifs protocol, the RFC1001 length, which cifs code (unlike in the smb2 code) had been handling as u32 until the last possible moment, when it was converted to be32 (its native form) before sending on the wire. To remove the last sparse endian warning, and to make this consistent with the smb2 implementation (which always treats the fields in their native size and endianness), convert all uses of smb_buf_length to be32. This version incorporates Christoph's comment about using be32_add_cpu, and fixes a typo in the second version of the patch. Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r--fs/cifs/sess.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index b6ff84af81a4..1daadade4d3c 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -621,7 +621,7 @@ ssetup_ntlmssp_authenticate:
and rest of bcc area. This allows us to avoid
a large buffer 17K allocation */
iov[0].iov_base = (char *)pSMB;
- iov[0].iov_len = smb_buf->smb_buf_length + 4;
+ iov[0].iov_len = be32_to_cpu(smb_buf->smb_buf_length) + 4;
/* setting this here allows the code at the end of the function
to free the request buffer if there's an error */
@@ -859,7 +859,8 @@ ssetup_ntlmssp_authenticate:
iov[2].iov_len = (long) bcc_ptr - (long) str_area;
count = iov[1].iov_len + iov[2].iov_len;
- smb_buf->smb_buf_length += count;
+ smb_buf->smb_buf_length =
+ cpu_to_be32(be32_to_cpu(smb_buf->smb_buf_length) + count);
put_bcc_le(count, smb_buf);