aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerie de Gram <j.de.gram@gmail.com>2011-10-28 18:01:52 +0200
committerJoerie de Gram <j.de.gram@gmail.com>2011-10-28 18:04:45 +0200
commit7d531412e240ef4a13541c6321602348b00dc6d3 (patch)
tree530d808823f765c3db1e210693f28f3fc8b33db2
parent635bcd54703a0ce4c7f2d4bab8b9d07cca04bbea (diff)
downloadexternal_libsamsung-ipc-7d531412e240ef4a13541c6321602348b00dc6d3.zip
external_libsamsung-ipc-7d531412e240ef4a13541c6321602348b00dc6d3.tar.gz
external_libsamsung-ipc-7d531412e240ef4a13541c6321602348b00dc6d3.tar.bz2
h1: add missing payload memcpy in h1_ipc_send
-rw-r--r--samsung-ipc/device/h1/h1_ipc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/samsung-ipc/device/h1/h1_ipc.c b/samsung-ipc/device/h1/h1_ipc.c
index 3b3ace9..601f67d 100644
--- a/samsung-ipc/device/h1/h1_ipc.c
+++ b/samsung-ipc/device/h1/h1_ipc.c
@@ -72,6 +72,7 @@ int h1_ipc_send(struct ipc_client *client, struct ipc_message_info *request)
{
struct hdlc_header *hdlc;
unsigned char *frame;
+ unsigned char *payload;
int frame_length;
/* Frame length: HDLC/IPC header + payload length + HDLC flags (2) */
@@ -87,7 +88,7 @@ int h1_ipc_send(struct ipc_client *client, struct ipc_message_info *request)
hdlc->length = (sizeof(*hdlc) + request->length);
hdlc->unknown = 0;
- /* IPC data */
+ /* IPC header */
hdlc->ipc.length = (sizeof(hdlc->ipc) + request->length);
hdlc->ipc.mseq = request->mseq;
hdlc->ipc.aseq = request->aseq;
@@ -95,6 +96,10 @@ int h1_ipc_send(struct ipc_client *client, struct ipc_message_info *request)
hdlc->ipc.index = request->index;
hdlc->ipc.type = request->type;
+ /* IPC payload */
+ payload = (frame + 1 + sizeof(*hdlc));
+ memcpy(payload, request->data, request->length);
+
ipc_client_log(client, "sending %s %s\n",
ipc_command_type_to_str(IPC_COMMAND(request)),
ipc_response_type_to_str(request->type));