diff options
author | Steve French <sfrench@us.ibm.com> | 2011-04-29 01:40:20 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-05-19 10:10:51 -0400 |
commit | be8e3b0044a68e1f1002c432f6b40d290cf0701d (patch) | |
tree | 41f6a5e2ccf4bf03eb722030563490bbe46f0644 /fs/cifs/sess.c | |
parent | 9409ae58e0759d010b347e7b19ebc90ab5d4b98f (diff) |
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.c | 5 |
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: | |||
621 | and rest of bcc area. This allows us to avoid | 621 | and rest of bcc area. This allows us to avoid |
622 | a large buffer 17K allocation */ | 622 | a large buffer 17K allocation */ |
623 | iov[0].iov_base = (char *)pSMB; | 623 | iov[0].iov_base = (char *)pSMB; |
624 | iov[0].iov_len = smb_buf->smb_buf_length + 4; | 624 | iov[0].iov_len = be32_to_cpu(smb_buf->smb_buf_length) + 4; |
625 | 625 | ||
626 | /* setting this here allows the code at the end of the function | 626 | /* setting this here allows the code at the end of the function |
627 | to free the request buffer if there's an error */ | 627 | to free the request buffer if there's an error */ |
@@ -859,7 +859,8 @@ ssetup_ntlmssp_authenticate: | |||
859 | iov[2].iov_len = (long) bcc_ptr - (long) str_area; | 859 | iov[2].iov_len = (long) bcc_ptr - (long) str_area; |
860 | 860 | ||
861 | count = iov[1].iov_len + iov[2].iov_len; | 861 | count = iov[1].iov_len + iov[2].iov_len; |
862 | smb_buf->smb_buf_length += count; | 862 | smb_buf->smb_buf_length = |
863 | cpu_to_be32(be32_to_cpu(smb_buf->smb_buf_length) + count); | ||
863 | 864 | ||
864 | put_bcc_le(count, smb_buf); | 865 | put_bcc_le(count, smb_buf); |
865 | 866 | ||