summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-11-05 11:40:02 +0100
committerStefan Metzmacher <metze@samba.org>2011-11-06 17:17:04 +0100
commit0c1669ee4b1783db98b0375dd5e4ed0dfc3e10c5 (patch)
treed88a13c23cbc4c2b718f580911ccaeeb66ac2b0f /source3/libsmb
parent1ad05d8c099b167f34ce616414c8ea5ca35db26f (diff)
downloadsamba-0c1669ee4b1783db98b0375dd5e4ed0dfc3e10c5.tar.gz
samba-0c1669ee4b1783db98b0375dd5e4ed0dfc3e10c5.tar.bz2
samba-0c1669ee4b1783db98b0375dd5e4ed0dfc3e10c5.zip
s3:smb2cli: ignore the NBT/Length header in smb2cli_inbuf_parse_compound()
This is not needed and in future we want to support SMBDirect, which add a different header. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Sun Nov 6 17:17:04 CET 2011 on sn-devel-104
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/smb2cli_base.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/libsmb/smb2cli_base.c b/source3/libsmb/smb2cli_base.c
index de4a06bd2d..3a59af0e11 100644
--- a/source3/libsmb/smb2cli_base.c
+++ b/source3/libsmb/smb2cli_base.c
@@ -401,22 +401,22 @@ static NTSTATUS smb2cli_inbuf_parse_compound(uint8_t *buf, TALLOC_CTX *mem_ctx,
int num_iov;
size_t buflen;
size_t taken;
+ uint8_t *first_hdr;
- num_iov = 1;
+ num_iov = 0;
iov = talloc_array(mem_ctx, struct iovec, num_iov);
if (iov == NULL) {
return NT_STATUS_NO_MEMORY;
}
- iov[0].iov_base = buf;
- iov[0].iov_len = 4;
- buflen = smb_len_tcp(buf) + 4;
- taken = 4;
+ buflen = smb_len_tcp(buf);
+ taken = 0;
+ first_hdr = buf + NBT_HDR_SIZE;
while (taken < buflen) {
size_t len = buflen - taken;
- uint8_t *hdr = buf + taken;
+ uint8_t *hdr = first_hdr + taken;
struct iovec *cur;
size_t full_size;
size_t next_command_ofs;
@@ -558,7 +558,7 @@ static void smb2cli_inbuf_received(struct tevent_req *subreq)
return;
}
- for (i=1; i<num_iov; i+=3) {
+ for (i=0; i<num_iov; i+=3) {
uint8_t *inbuf_ref = NULL;
struct iovec *cur = &iov[i];
uint8_t *inhdr = (uint8_t *)cur[0].iov_base;