cifs: mask off top byte in get_rfc1002_length()
authorJeff Layton <[email protected]>
Sun, 23 Feb 2014 00:35:38 +0000 (19:35 -0500)
committerSteve French <[email protected]>
Fri, 28 Feb 2014 20:01:14 +0000 (14:01 -0600)
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 <[email protected]>
Tested-by: Sachin Prabhu <[email protected]>
Signed-off-by: Steve French <[email protected]>
fs/cifs/cifsglob.h

index cf32f03933694cb56fd518a5e25388f35d834162..c0f3718b77a83e7e0e010b089e436356e83a1eb7 100644 (file)
@@ -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