s4:librpc/rpc: allow a total reassembled response payload of 240 MBytes
authorStefan Metzmacher <metze@samba.org>
Wed, 22 Jun 2016 15:18:28 +0000 (17:18 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 Jun 2016 22:50:17 +0000 (00:50 +0200)
This will replace DCERPC_NCACN_PAYLOAD_MAX_SIZE (4 MByte),
The limit of DCERPC_NCACN_PAYLOAD_MAX_SIZE (4 MByte) was too
strict for some workloads, e.g. DRSUAPI replication with large objects.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11948

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/librpc/rpc/dcerpc.c
source4/librpc/rpc/dcerpc.h

index 464ae9539a269e6d298e4b1d1eadcd869d309012..55b4385e42f41e6750635895dcd3983bac9454d5 100644 (file)
@@ -155,6 +155,7 @@ static struct dcecli_connection *dcerpc_connection_init(TALLOC_CTX *mem_ctx,
         */
        c->srv_max_xmit_frag = 5840;
        c->srv_max_recv_frag = 5840;
+       c->max_total_response_size = DCERPC_NCACN_RESPONSE_DEFAULT_MAX_SIZE;
        c->pending = NULL;
 
        c->io_trigger = tevent_create_immediate(c);
@@ -1577,10 +1578,10 @@ static void dcerpc_request_recv_data(struct dcecli_connection *c,
 
        length = pkt->u.response.stub_and_verifier.length;
 
-       if (req->payload.length + length > DCERPC_NCACN_PAYLOAD_MAX_SIZE) {
+       if (req->payload.length + length > c->max_total_response_size) {
                DEBUG(2,("Unexpected total payload 0x%X > 0x%X dcerpc response\n",
                         (unsigned)req->payload.length + length,
-                        DCERPC_NCACN_PAYLOAD_MAX_SIZE));
+                        (unsigned)c->max_total_response_size));
                dcerpc_connection_dead(c, NT_STATUS_RPC_PROTOCOL_ERROR);
                return;
        }
index 39d28a6e5d4bff6072ae663172906bda4a7cd021..24c794800a1d9a841140f52a183810fbf70b682b 100644 (file)
@@ -107,6 +107,9 @@ struct dcecli_connection {
 
        /* the next context_id to be assigned */
        uint32_t next_context_id;
+
+       /* The maximum total payload of reassembled response pdus */
+       size_t max_total_response_size;
 };
 
 /*