diff options
| author | ZhangGuoDong <zhangguodong@kylinos.cn> | 2025-10-27 15:12:56 +0800 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2025-11-30 21:11:44 -0600 |
| commit | cd311445d9f5510979f6e9f4344178b9f5a4d981 (patch) | |
| tree | e5f747fc9f94260a8fe143c180d69067be63b3ab /fs | |
| parent | 36c31540cf5279262bfd148d8537cd04866499f2 (diff) | |
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>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/smb/client/misc.c | 2 | ||||
| -rw-r--r-- | fs/smb/common/smbglob.h | 2 | ||||
| -rw-r--r-- | fs/smb/server/smb_common.h | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c index e10123d8cd7d..340c44dc7b5b 100644 --- a/fs/smb/client/misc.c +++ b/fs/smb/client/misc.c @@ -318,7 +318,7 @@ static int check_smb_hdr(struct smb_hdr *smb) { /* does it have the right SMB "signature" ? */ - if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) { + if (*(__le32 *) smb->Protocol != SMB1_PROTO_NUMBER) { cifs_dbg(VFS, "Bad protocol string signature header 0x%x\n", *(unsigned int *)smb->Protocol); return 1; diff --git a/fs/smb/common/smbglob.h b/fs/smb/common/smbglob.h index b258199b0d75..fa3d30dc6022 100644 --- a/fs/smb/common/smbglob.h +++ b/fs/smb/common/smbglob.h @@ -9,6 +9,8 @@ #ifndef _COMMON_SMB_GLOB_H #define _COMMON_SMB_GLOB_H +#define SMB1_PROTO_NUMBER cpu_to_le32(0x424d53ff) + struct smb_version_values { char *version_string; __u16 protocol_id; diff --git a/fs/smb/server/smb_common.h b/fs/smb/server/smb_common.h index ff3e441da125..0e291fe2d190 100644 --- a/fs/smb/server/smb_common.h +++ b/fs/smb/server/smb_common.h @@ -151,7 +151,6 @@ FILE_EXECUTE | FILE_DELETE_CHILD | \ FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES) -#define SMB1_PROTO_NUMBER cpu_to_le32(0x424d53ff) #define SMB_COM_NEGOTIATE 0x72 #define SMB1_CLIENT_GUID_SIZE (16) |