summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2010-07-11 12:18:13 -0400
committerGünther Deschner <gd@samba.org>2010-07-13 14:44:11 +0200
commit87605e2030262bc24b59468fe4b5837e8ff584b0 (patch)
treec9e769f6b7afd9d8879bd1588e8501ed4f0cdd8a /source3
parentfe9036cf5bd8aa775a0419be8effae257d6f97f2 (diff)
downloadsamba-87605e2030262bc24b59468fe4b5837e8ff584b0.tar.gz
samba-87605e2030262bc24b59468fe4b5837e8ff584b0.tar.bz2
samba-87605e2030262bc24b59468fe4b5837e8ff584b0.zip
s3-dcerpc: fix dcerpc_push_ncacn_packet, pass arg by address
There is no need to copy the whole structure twice by passing it in by value. Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/rpc_client/cli_pipe.c10
-rw-r--r--source3/rpc_server/srv_pipe.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index a8fa4c1977..0fbe70a89c 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4850,7 +4850,7 @@ NTSTATUS dcerpc_push_ncacn_packet(TALLOC_CTX *mem_ctx,
uint8_t pfc_flags,
uint16_t auth_length,
uint32_t call_id,
- union dcerpc_payload u,
+ union dcerpc_payload *u,
DATA_BLOB *blob);
NTSTATUS dcerpc_push_ncacn_packet_header(TALLOC_CTX *mem_ctx,
enum dcerpc_pkt_type ptype,
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 13d2e87653..91eb767667 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -302,7 +302,7 @@ NTSTATUS dcerpc_push_ncacn_packet(TALLOC_CTX *mem_ctx,
uint8_t pfc_flags,
uint16_t auth_length,
uint32_t call_id,
- union dcerpc_payload u,
+ union dcerpc_payload *u,
DATA_BLOB *blob)
{
struct ncacn_packet r;
@@ -318,7 +318,7 @@ NTSTATUS dcerpc_push_ncacn_packet(TALLOC_CTX *mem_ctx,
r.drep[3] = 0;
r.auth_length = auth_length;
r.call_id = call_id;
- r.u = u;
+ r.u = *u;
ndr_err = ndr_push_struct_blob(blob, mem_ctx, &r,
(ndr_push_flags_fn_t)ndr_push_ncacn_packet);
@@ -2087,7 +2087,7 @@ static NTSTATUS create_bind_or_alt_ctx_internal(enum dcerpc_pkt_type ptype,
DCERPC_PFC_FLAG_LAST,
auth_len ? auth_len - RPC_HDR_AUTH_LEN : 0,
rpc_call_id,
- u,
+ &u,
&blob);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("create_bind_or_alt_ctx_internal: failed to marshall RPC_HDR_RB.\n"));
@@ -2529,7 +2529,7 @@ static NTSTATUS prepare_next_frag(struct rpc_api_pipe_req_state *state,
flags,
auth_len,
state->call_id,
- u,
+ &u,
&blob);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -2789,7 +2789,7 @@ static NTSTATUS create_rpc_bind_auth3(struct rpc_pipe_client *cli,
DCERPC_PFC_FLAG_LAST,
pauth_blob->length,
rpc_call_id,
- u,
+ &u,
&blob);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("create_bind_or_alt_ctx_internal: failed to marshall RPC_HDR_RB.\n"));
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index 53ddfcbafd..dbaaea61b9 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -870,7 +870,7 @@ static bool setup_bind_nak(pipes_struct *p, struct ncacn_packet *pkt)
DCERPC_PFC_FLAG_LAST,
0,
pkt->call_id,
- u,
+ &u,
&blob);
if (!NT_STATUS_IS_OK(status)) {
prs_mem_free(&p->out_data.frag);
@@ -933,7 +933,7 @@ bool setup_fault_pdu(pipes_struct *p, NTSTATUS fault_status)
DCERPC_PFC_FLAG_DID_NOT_EXECUTE,
0,
p->call_id,
- u,
+ &u,
&blob);
if (!NT_STATUS_IS_OK(status)) {
prs_mem_free(&p->out_data.frag);