summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Herrmann <fherrmann@de.adit-jv.com>2020-01-14 16:49:42 +0100
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2020-07-06 10:04:07 +0900
commitabb804937568b4fdf8e9c375b7ec2819c50f5eb9 (patch)
treed7764a7e7932b71d56d7d7975bec4622e7e63fd3
parent6af7a235943032aaf7153e848c076fe16418210a (diff)
downloadDLT-daemon-abb804937568b4fdf8e9c375b7ec2819c50f5eb9.tar.gz
fix gateway config element search
Only the first configured passive node was checked when a connection request was issued. Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
-rw-r--r--src/gateway/dlt_gateway.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gateway/dlt_gateway.c b/src/gateway/dlt_gateway.c
index 57d801b..6680ac8 100644
--- a/src/gateway/dlt_gateway.c
+++ b/src/gateway/dlt_gateway.c
@@ -1476,7 +1476,7 @@ int dlt_gateway_forward_control_message(DltGateway *gateway,
int dlt_gateway_process_on_demand_request(DltGateway *gateway,
DltDaemonLocal *daemon_local,
- char *node_id,
+ char node_id[DLT_ID_SIZE],
int connection_status,
int verbose)
{
@@ -1491,13 +1491,12 @@ int dlt_gateway_process_on_demand_request(DltGateway *gateway,
}
/* find connection by ECU id */
- for (i = 0; i < gateway->num_connections; i++)
- if (strncmp(node_id, gateway->connections->ecuid, DLT_ID_SIZE) == 0) {
+ for (i = 0; i < gateway->num_connections; i++) {
+ if (strncmp(node_id, gateway->connections[i].ecuid, DLT_ID_SIZE) == 0) {
con = &gateway->connections[i];
break;
}
-
-
+ }
if (con == NULL) {
dlt_log(LOG_WARNING, "Specified ECUid not found\n");