From 4c64e4d4af3403559b370381d7f14a83a39adfa7 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 30 Jul 2010 13:12:35 -0400 Subject: s3-dceprc: Improve dcerpc_guess_sizes() interface Make it possible to pass in the NDR padding size so that theoretically client and server code can decide to use a different alignment. Pass in the header length as a parameter so that this function can be used for different type of packets. Make sure padding size will not make the fragment exceed the maximum length. Calculate padding taking in account the header length. --- source3/rpc_client/cli_pipe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 99e856dfd8..2bb9aad9e3 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -1286,8 +1286,10 @@ static NTSTATUS prepare_next_frag(struct rpc_api_pipe_req_state *state, data_left = state->req_data->length - state->req_data_sent; - status = dcerpc_guess_sizes(state->cli->auth, data_left, + status = dcerpc_guess_sizes(state->cli->auth, + DCERPC_REQUEST_LENGTH, data_left, state->cli->max_xmit_frag, + CLIENT_NDR_PADDING_SIZE, &data_sent_thistime, &frag_len, &auth_len, &pad_len); if (!NT_STATUS_IS_OK(status)) { -- cgit