The branch, v4-0-test has been updated
       via  351947dba3f7a26ac871d4aa7b6bba4cd472383a (commit)
       via  9ff0ce42b32bf0f1463d2cb9c2a6595f51b13d04 (commit)
      from  e633dc4ec2d72c3d34b5e096e0460e07e07ab514 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 351947dba3f7a26ac871d4aa7b6bba4cd472383a
Author: Stefan Metzmacher <[EMAIL PROTECTED]>
Date:   Thu Jul 3 13:40:31 2008 +0200

    dcerpc.idl: the signing overhead can be more than 32 bytes
    
    Windows seems to use 64 here, so we do now.
    
    Before we got nca_proto_error fault because we send fragments
    larger than the negotiated max frag size.
    
    If the max frag size is 5840, we're sending 5837 bytes
    when the auth_len is 45 and that matches w2k3 traffic.
    
    metze

commit 9ff0ce42b32bf0f1463d2cb9c2a6595f51b13d04
Author: Stefan Metzmacher <[EMAIL PROTECTED]>
Date:   Thu Jul 3 13:39:55 2008 +0200

    rpc_server: use the same chunk_size logic as we we use in the client
    
    metze

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

Summary of changes:
 source/librpc/idl/dcerpc.idl      |    2 +-
 source/rpc_server/dcerpc_server.c |   14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/librpc/idl/dcerpc.idl b/source/librpc/idl/dcerpc.idl
index e228d85..57028ff 100644
--- a/source/librpc/idl/dcerpc.idl
+++ b/source/librpc/idl/dcerpc.idl
@@ -30,7 +30,7 @@ interface dcerpc
        } dcerpc_bind;
 
        const uint8 DCERPC_REQUEST_LENGTH = 24;
-       const uint8 DCERPC_MAX_SIGN_SIZE  = 32;
+       const uint8 DCERPC_MAX_SIGN_SIZE  = 64;
 
        typedef struct {
        } dcerpc_empty;
diff --git a/source/rpc_server/dcerpc_server.c 
b/source/rpc_server/dcerpc_server.c
index e0351bb..d8dafd6 100644
--- a/source/rpc_server/dcerpc_server.c
+++ b/source/rpc_server/dcerpc_server.c
@@ -886,7 +886,7 @@ _PUBLIC_ NTSTATUS dcesrv_reply(struct dcesrv_call_state 
*call)
        struct ndr_push *push;
        NTSTATUS status;
        DATA_BLOB stub;
-       uint32_t total_length;
+       uint32_t total_length, chunk_size;
        struct dcesrv_connection_context *context = call->context;
 
        /* call the reply function */
@@ -917,20 +917,20 @@ _PUBLIC_ NTSTATUS dcesrv_reply(struct dcesrv_call_state 
*call)
 
        total_length = stub.length;
 
+       /* we can write a full max_recv_frag size, minus the dcerpc
+          request header size */
+       chunk_size = call->conn->cli_max_recv_frag - 
(DCERPC_MAX_SIGN_SIZE+DCERPC_REQUEST_LENGTH);
+
        do {
                uint32_t length;
                struct data_blob_list_item *rep;
                struct ncacn_packet pkt;
+               const uint32_t overhead = 
(DCERPC_MAX_SIGN_SIZE+DCERPC_RESPONSE_LENGTH);
 
                rep = talloc(call, struct data_blob_list_item);
                NT_STATUS_HAVE_NO_MEMORY(rep);
 
-               length = stub.length;
-               if (length + DCERPC_RESPONSE_LENGTH > 
call->conn->cli_max_recv_frag) {
-                       /* the 32 is to cope with signing data */
-                       length = call->conn->cli_max_recv_frag - 
-                               (DCERPC_MAX_SIGN_SIZE+DCERPC_RESPONSE_LENGTH);
-               }
+               length = MIN(chunk_size, stub.length);
 
                /* form the dcerpc response packet */
                dcesrv_init_hdr(&pkt, 
lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx));


-- 
Samba Shared Repository

Reply via email to