summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/dlt_daemon_client.c')
-rw-r--r--src/daemon/dlt_daemon_client.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c
index 9450e77..941aa8c 100644
--- a/src/daemon/dlt_daemon_client.c
+++ b/src/daemon/dlt_daemon_client.c
@@ -1544,7 +1544,7 @@ void dlt_daemon_control_callsw_cinjection(int sock,
PRINT_FUNCTION_VERBOSE(verbose);
- if ((daemon == NULL) || (msg == NULL) || (msg->databuffer == NULL))
+ if ((daemon == NULL) || (daemon_local == NULL) || (msg == NULL) || (msg->databuffer == NULL))
return;
datalength = msg->datasize;
@@ -1553,6 +1553,12 @@ void dlt_daemon_control_callsw_cinjection(int sock,
DLT_MSG_READ_VALUE(id_tmp, ptr, datalength, uint32_t); /* Get service id */
id = DLT_ENDIAN_GET_32(msg->standardheader->htyp, id_tmp);
+ /* injectionMode is disabled */
+ if (daemon_local->flags.injectionMode == 0) {
+ dlt_daemon_control_service_response(sock, daemon, daemon_local, id, DLT_SERVICE_RESPONSE_PERM_DENIED, verbose);
+ return;
+ }
+
/* id is always less than DLT_DAEMON_INJECTION_MAX since its type is uinit32_t */
if (id >= DLT_DAEMON_INJECTION_MIN) {
/* This a a real SW-C injection call */