diff options
Diffstat (limited to 'fs/cifs/misc.c')
-rw-r--r-- | fs/cifs/misc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 0c684ae4c071..907531ac5888 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -304,12 +304,10 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ , | |||
304 | 304 | ||
305 | memset(temp, 0, 256); /* bigger than MAX_CIFS_HDR_SIZE */ | 305 | memset(temp, 0, 256); /* bigger than MAX_CIFS_HDR_SIZE */ |
306 | 306 | ||
307 | buffer->smb_buf_length = | 307 | buffer->smb_buf_length = cpu_to_be32( |
308 | (2 * word_count) + sizeof(struct smb_hdr) - | 308 | (2 * word_count) + sizeof(struct smb_hdr) - |
309 | 4 /* RFC 1001 length field does not count */ + | 309 | 4 /* RFC 1001 length field does not count */ + |
310 | 2 /* for bcc field itself */ ; | 310 | 2 /* for bcc field itself */) ; |
311 | /* Note that this is the only network field that has to be converted | ||
312 | to big endian and it is done just before we send it */ | ||
313 | 311 | ||
314 | buffer->Protocol[0] = 0xFF; | 312 | buffer->Protocol[0] = 0xFF; |
315 | buffer->Protocol[1] = 'S'; | 313 | buffer->Protocol[1] = 'S'; |
@@ -424,7 +422,7 @@ check_smb_hdr(struct smb_hdr *smb, __u16 mid) | |||
424 | int | 422 | int |
425 | checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length) | 423 | checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length) |
426 | { | 424 | { |
427 | __u32 len = smb->smb_buf_length; | 425 | __u32 len = be32_to_cpu(smb->smb_buf_length); |
428 | __u32 clc_len; /* calculated length */ | 426 | __u32 clc_len; /* calculated length */ |
429 | cFYI(0, "checkSMB Length: 0x%x, smb_buf_length: 0x%x", length, len); | 427 | cFYI(0, "checkSMB Length: 0x%x, smb_buf_length: 0x%x", length, len); |
430 | 428 | ||
@@ -464,7 +462,7 @@ checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length) | |||
464 | 462 | ||
465 | if (check_smb_hdr(smb, mid)) | 463 | if (check_smb_hdr(smb, mid)) |
466 | return 1; | 464 | return 1; |
467 | clc_len = smbCalcSize_LE(smb); | 465 | clc_len = smbCalcSize(smb); |
468 | 466 | ||
469 | if (4 + len != length) { | 467 | if (4 + len != length) { |
470 | cERROR(1, "Length read does not match RFC1001 length %d", | 468 | cERROR(1, "Length read does not match RFC1001 length %d", |
@@ -521,7 +519,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) | |||
521 | (struct smb_com_transaction_change_notify_rsp *)buf; | 519 | (struct smb_com_transaction_change_notify_rsp *)buf; |
522 | struct file_notify_information *pnotify; | 520 | struct file_notify_information *pnotify; |
523 | __u32 data_offset = 0; | 521 | __u32 data_offset = 0; |
524 | if (get_bcc_le(buf) > sizeof(struct file_notify_information)) { | 522 | if (get_bcc(buf) > sizeof(struct file_notify_information)) { |
525 | data_offset = le32_to_cpu(pSMBr->DataOffset); | 523 | data_offset = le32_to_cpu(pSMBr->DataOffset); |
526 | 524 | ||
527 | pnotify = (struct file_notify_information *) | 525 | pnotify = (struct file_notify_information *) |