summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2maperror.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilov@microsoft.com>2016-10-24 15:33:04 -0700
committerSteve French <smfrench@gmail.com>2017-02-01 16:46:34 -0600
commit31473fc4f9653b73750d3792ffce6a6e1bdf0da7 (patch)
treebb789f590f828d3da748de876a7fafa43e654e7a /fs/cifs/smb2maperror.c
parent9c25702cee1405099f982894c865c163de7909a8 (diff)
downloadlinux-31473fc4f9653b73750d3792ffce6a6e1bdf0da7.tar.bz2
CIFS: Separate SMB2 header structure
In order to support compounding and encryption we need to separate RFC1001 length field and SMB2 header structure because the protocol treats them differently. This change will allow to simplify parsing of such complex SMB2 packets further. Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Diffstat (limited to 'fs/cifs/smb2maperror.c')
-rw-r--r--fs/cifs/smb2maperror.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c
index 8257a5a97cc0..3030a9dfb0dd 100644
--- a/fs/cifs/smb2maperror.c
+++ b/fs/cifs/smb2maperror.c
@@ -26,6 +26,7 @@
#include "smb2pdu.h"
#include "smb2proto.h"
#include "smb2status.h"
+#include "smb2glob.h"
struct status_to_posix_error {
__le32 smb2_status;
@@ -2449,10 +2450,10 @@ smb2_print_status(__le32 status)
int
map_smb2_to_linux_error(char *buf, bool log_err)
{
- struct smb2_hdr *hdr = (struct smb2_hdr *)buf;
+ struct smb2_sync_hdr *shdr = get_sync_hdr(buf);
unsigned int i;
int rc = -EIO;
- __le32 smb2err = hdr->Status;
+ __le32 smb2err = shdr->Status;
if (smb2err == 0)
return 0;