Commit 9bb17e09 authored by Pavel Shilovsky's avatar Pavel Shilovsky Committed by Steve French

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: default avatarPavel Shilovsky <pshilov@microsoft.com>
parent 026e93dc
...@@ -440,6 +440,9 @@ struct smb_version_operations { ...@@ -440,6 +440,9 @@ struct smb_version_operations {
struct smb_rqst *); struct smb_rqst *);
/* free transform request */ /* free transform request */
void (*free_transform_rq)(struct smb_rqst *); 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 { struct smb_version_values {
......
...@@ -872,12 +872,19 @@ cifs_demultiplex_thread(void *p) ...@@ -872,12 +872,19 @@ cifs_demultiplex_thread(void *p)
continue; continue;
server->total_read += length; server->total_read += length;
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); mid_entry = server->ops->find_mid(server, buf);
if (!mid_entry || !mid_entry->receive) if (!mid_entry || !mid_entry->receive)
length = standard_receive3(server, mid_entry); length = standard_receive3(server, mid_entry);
else else
length = mid_entry->receive(server, mid_entry); length = mid_entry->receive(server, mid_entry);
}
if (length < 0) if (length < 0)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment