CIFS: Add transform header handling callbacks

We need to recognize and parse transformed packets in demultiplex
thread to find a corresponsing mid and process it further.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
This commit is contained in:
Pavel Shilovsky 2016-11-17 15:24:34 -08:00 committed by Steve French
parent 026e93dc0a
commit 9bb17e0916
2 changed files with 15 additions and 5 deletions

View File

@ -440,6 +440,9 @@ struct smb_version_operations {
struct smb_rqst *);
/* free transform request */
void (*free_transform_rq)(struct smb_rqst *);
int (*is_transform_hdr)(void *buf);
int (*receive_transform)(struct TCP_Server_Info *,
struct mid_q_entry **);
};
struct smb_version_values {

View File

@ -872,12 +872,19 @@ cifs_demultiplex_thread(void *p)
continue;
server->total_read += length;
mid_entry = server->ops->find_mid(server, buf);
if (server->ops->is_transform_hdr &&
server->ops->receive_transform &&
server->ops->is_transform_hdr(buf)) {
length = server->ops->receive_transform(server,
&mid_entry);
} else {
mid_entry = server->ops->find_mid(server, buf);
if (!mid_entry || !mid_entry->receive)
length = standard_receive3(server, mid_entry);
else
length = mid_entry->receive(server, mid_entry);
if (!mid_entry || !mid_entry->receive)
length = standard_receive3(server, mid_entry);
else
length = mid_entry->receive(server, mid_entry);
}
if (length < 0)
continue;