The branch, master has been updated
       via  0c1669e s3:smb2cli: ignore the NBT/Length header in 
smb2cli_inbuf_parse_compound()
      from  1ad05d8 Some formatting fixes, remove unused imports.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0c1669ee4b1783db98b0375dd5e4ed0dfc3e10c5
Author: Stefan Metzmacher <[email protected]>
Date:   Sat Nov 5 11:40:02 2011 +0100

    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 <[email protected]>
    Autobuild-Date: Sun Nov  6 17:17:04 CET 2011 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source3/libsmb/smb2cli_base.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/smb2cli_base.c b/source3/libsmb/smb2cli_base.c
index de4a06b..3a59af0 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;


-- 
Samba Shared Repository

Reply via email to