From: Jeff Layton Date: Sun, 23 Feb 2014 00:35:38 +0000 (-0500) Subject: cifs: mask off top byte in get_rfc1002_length() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dca1c8d17a2feae056f9e334ea75a462ae4cb52a;p=linux-beck.git cifs: mask off top byte in get_rfc1002_length() The rfc1002 length actually includes a type byte, which we aren't masking off. In most cases, it's not a problem since the RFC1002_SESSION_MESSAGE type is 0, but when doing a RFC1002 session establishment, the type is non-zero and that throws off the returned length. Signed-off-by: Jeff Layton Tested-by: Sachin Prabhu Signed-off-by: Steve French --- diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index cf32f0393369..c0f3718b77a8 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -513,7 +513,7 @@ struct cifs_mnt_data { static inline unsigned int get_rfc1002_length(void *buf) { - return be32_to_cpu(*((__be32 *)buf)); + return be32_to_cpu(*((__be32 *)buf)) & 0xffffff; } static inline void