Skip to content

Commit cd31144

Browse files
ZhangGuoDongsmfrench
authored andcommitted
smb: move SMB1_PROTO_NUMBER to common/smbglob.h
Replace the constant of client with SMB1_PROTO_NUMBER, then move the macro definition from server/smb_common.h to common/smbglob.h. Co-developed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Suggested-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 36c3154 commit cd31144

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

fs/smb/client/misc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ static int
318318
check_smb_hdr(struct smb_hdr *smb)
319319
{
320320
/* does it have the right SMB "signature" ? */
321-
if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) {
321+
if (*(__le32 *) smb->Protocol != SMB1_PROTO_NUMBER) {
322322
cifs_dbg(VFS, "Bad protocol string signature header 0x%x\n",
323323
*(unsigned int *)smb->Protocol);
324324
return 1;

fs/smb/common/smbglob.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#ifndef _COMMON_SMB_GLOB_H
1010
#define _COMMON_SMB_GLOB_H
1111

12+
#define SMB1_PROTO_NUMBER cpu_to_le32(0x424d53ff)
13+
1214
struct smb_version_values {
1315
char *version_string;
1416
__u16 protocol_id;

fs/smb/server/smb_common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@
151151
FILE_EXECUTE | FILE_DELETE_CHILD | \
152152
FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES)
153153

154-
#define SMB1_PROTO_NUMBER cpu_to_le32(0x424d53ff)
155154
#define SMB_COM_NEGOTIATE 0x72
156155
#define SMB1_CLIENT_GUID_SIZE (16)
157156

0 commit comments

Comments
 (0)