From 12ced8236628c8a5bd317c5605f970d4cde73bd1 Mon Sep 17 00:00:00 2001 From: Yusuke Sato Date: Tue, 1 Mar 2016 09:21:47 +0100 Subject: Fix: dlt-daemon overwrites ECU ID even if user log message already has the ECU ID that is not default value dlt-daemon overwrites ECU ID even if user log message already has the ECU ID that is not default value. This phenomenon happens when application uses dlt_forward_msg(). Therefore, dlt-daemon is modified not to overwrite ECU ID if log message has already has the ECU ID. Signed-off-by: Yusuke Sato Change-Id: Icbc6304e5571242bf75ff0d32cbe4b004f1d7f9d --- src/daemon/dlt-daemon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/daemon/dlt-daemon.c') diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c index 28ed4aa..2444e4c 100644 --- a/src/daemon/dlt-daemon.c +++ b/src/daemon/dlt-daemon.c @@ -2568,7 +2568,7 @@ int dlt_daemon_process_user_message_log(DltDaemon *daemon, } /* set overwrite ecu id */ - if (daemon_local->flags.evalue!=0) + if ((daemon_local->flags.evalue[0]) && (strncmp(daemon_local->msg.headerextra.ecu,DLT_DAEMON_ECU_ID,4)==0)) { /* Set header extra parameters */ dlt_set_id(daemon_local->msg.headerextra.ecu, daemon->ecuid ); @@ -2734,7 +2734,7 @@ int dlt_daemon_process_user_message_log_shm(DltDaemon *daemon, } /* set overwrite ecu id */ - if (daemon_local->flags.evalue[0]) + if ((daemon_local->flags.evalue[0]) && (strncmp(daemon_local->msg.headerextra.ecu,DLT_DAEMON_ECU_ID,4)==0)) { /* Set header extra parameters */ dlt_set_id(daemon_local->msg.headerextra.ecu, daemon->ecuid ); -- cgit v1.2.1