From abb804937568b4fdf8e9c375b7ec2819c50f5eb9 Mon Sep 17 00:00:00 2001 From: Felix Herrmann Date: Tue, 14 Jan 2020 16:49:42 +0100 Subject: fix gateway config element search Only the first configured passive node was checked when a connection request was issued. Signed-off-by: Felix Herrmann --- src/gateway/dlt_gateway.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/gateway') 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"); -- cgit v1.2.1