Skip to content

Commit

Permalink
cifs: fix length vs. total_read confusion in cifs_demultiplex_thread
Browse files Browse the repository at this point in the history
length at this point is the length returned by the last kernel_recvmsg
call. total_read is the length of all of the data read so far. length
is more or less meaningless at this point, so use total_read for
everything.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
Jeff Layton authored and Steve French committed Feb 2, 2011
1 parent afe8a88 commit 9587fcf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,12 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
else if (reconnect == 1)
continue;

length += 4; /* account for rfc1002 hdr */
total_read += 4; /* account for rfc1002 hdr */


dump_smb(smb_buffer, length);
if (checkSMB(smb_buffer, smb_buffer->Mid, total_read+4)) {
cifs_dump_mem("Bad SMB: ", smb_buffer, 48);
dump_smb(smb_buffer, total_read);
if (checkSMB(smb_buffer, smb_buffer->Mid, total_read)) {
cifs_dump_mem("Bad SMB: ", smb_buffer,
total_read < 48 ? total_read : 48);
continue;
}

Expand Down

0 comments on commit 9587fcf

Please sign in to comment.