aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsencrypt.c
diff options
context:
space:
mode:
authorZhang Xiaoxu <zhangxiaoxu5@huawei.com>2022-08-23 20:52:02 +0800
committerSteve French <stfrench@microsoft.com>2022-08-24 22:30:09 -0500
commitd291e703f420d5f8f999fe54f360d54d213bddb4 (patch)
tree12bac3fe7ea04b16c037e77d1b003c2922162fea /fs/cifs/cifsencrypt.c
parentcifs: Use help macro to get the mid header size (diff)
downloadlinux-dev-d291e703f420d5f8f999fe54f360d54d213bddb4.tar.xz
linux-dev-d291e703f420d5f8f999fe54f360d54d213bddb4.zip
cifs: Add helper function to check smb1+ server
SMB1 server's header_preamble_size is not 0, add use is_smb1 function to simplify the code, no actual functional changes. Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cifsencrypt.c')
-rw-r--r--fs/cifs/cifsencrypt.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index 61a9fed56548..46f5718754f9 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -32,10 +32,9 @@ int __cifs_calc_signature(struct smb_rqst *rqst,
int rc;
struct kvec *iov = rqst->rq_iov;
int n_vec = rqst->rq_nvec;
- bool is_smb2 = HEADER_PREAMBLE_SIZE(server) == 0;
/* iov[0] is actual data and not the rfc1002 length for SMB2+ */
- if (is_smb2) {
+ if (!is_smb1(server)) {
if (iov[0].iov_len <= 4)
return -EIO;
i = 0;