diff options
Diffstat (limited to 'source3/rpc_server/srv_pipe_hnd.c')
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index 3055e1a29c..51f30cea25 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -406,25 +406,27 @@ static void process_complete_pdu(pipes_struct *p) goto done; } - status = dcerpc_pull_ncacn_packet(pkt, &p->in_data.pdu, pkt); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0, ("Failed to unmarshal rpc packet: %s!\n", - nt_errstr(status))); - goto done; - } - - /* Store the call_id */ - p->call_id = pkt->call_id; - /* * Ensure we're using the corrent endianness for both the * RPC header flags and the raw data we will be reading from. */ - if (pkt->drep[0] == DCERPC_DREP_LE) { + if (dcerpc_get_endian_flag(&p->in_data.pdu) & DCERPC_DREP_LE) { p->endian = RPC_LITTLE_ENDIAN; } else { p->endian = RPC_BIG_ENDIAN; } + DEBUG(10, ("PDU is in %s Endian format!\n", p->endian?"Big":"Little")); + + status = dcerpc_pull_ncacn_packet(pkt, &p->in_data.pdu, + pkt, p->endian); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("Failed to unmarshal rpc packet: %s!\n", + nt_errstr(status))); + goto done; + } + + /* Store the call_id */ + p->call_id = pkt->call_id; DEBUG(10, ("Processing packet type %d\n", (int)pkt->ptype)); |