From c5bc949a9685bd05d727d969ac646f43deb1e7c0 Mon Sep 17 00:00:00 2001 From: Jaroslava Fiedlerova Date: Tue, 22 Jul 2025 14:45:12 +0200 Subject: [PATCH] rfsimulator: fix model name for channel bridge->nb_cnx++ is done before calling snprintf(modelname,... in the function, so we take the model name of the next channel. This commit corrects the issue by using bridge->nb_cnx - 1, ensuring that the model name corresponds to the currently connected client. This bug was introduced by MR !3455. Co-authored-by: Bartosz Podrygajlo Co-authored-by: Laurent THOMAS --- radio/rfsimulator/simulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/rfsimulator/simulator.c b/radio/rfsimulator/simulator.c index ca28dd2e79..c60192bc93 100644 --- a/radio/rfsimulator/simulator.c +++ b/radio/rfsimulator/simulator.c @@ -218,7 +218,7 @@ static buffer_t *allocCirBuf(rfsimulator_state_t *bridge, int sock) sizeofArray(modelname), "rfsimu_channel_%s%d", (bridge->role == SIMU_ROLE_SERVER) ? "ue" : "enB", - bridge->nb_cnx); + bridge->nb_cnx - 1); ptr->channel_model = find_channel_desc_fromname(modelname); // path_loss in dB if (!ptr->channel_model) { // Use legacy method to find channel model - this will use the same channel model for all clients