summaryrefslogtreecommitdiff
path: root/librpc/rpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-09-11 12:23:27 +0200
committerStefan Metzmacher <metze@samba.org>2014-01-07 08:37:36 +0100
commitef568f425c4199960bd9eb10c5769902f5eb6593 (patch)
tree835eaba407f330c41429cefbcb888a70079dcc5b /librpc/rpc
parentcd4643730552674b2a10a37665eeac13c58940a8 (diff)
downloadsamba-ef568f425c4199960bd9eb10c5769902f5eb6593.tar.gz
librpc/rpc: read the full header in dcerpc_read_ncacn_packet_next_vector()
This helps wireshark reassamble the PDUs generated by socket_wrapper. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'librpc/rpc')
-rw-r--r--librpc/rpc/dcerpc_util.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/librpc/rpc/dcerpc_util.c b/librpc/rpc/dcerpc_util.c
index 4046f327e2f..575b3a2007e 100644
--- a/librpc/rpc/dcerpc_util.c
+++ b/librpc/rpc/dcerpc_util.c
@@ -209,15 +209,21 @@ static int dcerpc_read_ncacn_packet_next_vector(struct tstream_context *stream,
off_t ofs = 0;
if (state->buffer.length == 0) {
- /* first get enough to read the fragment length */
+ /*
+ * first get enough to read the fragment length
+ *
+ * We read the full fixed ncacn_packet header
+ * in order to make wireshark happy with
+ * pcap files from socket_wrapper.
+ */
ofs = 0;
- state->buffer.length = DCERPC_FRAG_LEN_OFFSET + 2;
+ state->buffer.length = DCERPC_NCACN_PAYLOAD_OFFSET;
state->buffer.data = talloc_array(state, uint8_t,
state->buffer.length);
if (!state->buffer.data) {
return -1;
}
- } else if (state->buffer.length == (DCERPC_FRAG_LEN_OFFSET + 2)) {
+ } else if (state->buffer.length == DCERPC_NCACN_PAYLOAD_OFFSET) {
/* now read the fragment length and allocate the full buffer */
size_t frag_len = dcerpc_get_frag_length(&state->buffer);