From 275750086a372ad204f3fa916f9617ab793ae9b7 Mon Sep 17 00:00:00 2001 From: Bogdan Andrei IANCU Date: Fri, 7 Feb 2025 17:59:15 +0200 Subject: [PATCH] Merge pull request #3574 from babakyakhchali/bugfix/3567 dispatcher: fix persistent_state (cherry picked from commit a0feb32ab1bc0acda0022e805a43605f9cf3a3b4) --- modules/dispatcher/dispatcher.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/dispatcher/dispatcher.c b/modules/dispatcher/dispatcher.c index 789ff837c21..5cb8f95ec89 100644 --- a/modules/dispatcher/dispatcher.c +++ b/modules/dispatcher/dispatcher.c @@ -760,13 +760,13 @@ static int partition_init(ds_db_head_t *db_head, ds_partition_t *partition) LM_ERR("cannot duplicate ping_method\n"); } partition->persistent_state = ds_persistent_state; - if (str_strcmp(&db_head->persistent_state, const_str("0")) || - str_strcmp(&db_head->persistent_state, const_str("no")) || - str_strcmp(&db_head->persistent_state, const_str("off"))) + if (str_strcmp(&db_head->persistent_state, const_str("0")) == 0 || + str_strcmp(&db_head->persistent_state, const_str("no")) == 0 || + str_strcmp(&db_head->persistent_state, const_str("off")) == 0) partition->persistent_state = 0; - else if (str_strcmp(&db_head->persistent_state, const_str("1")) || - str_strcmp(&db_head->persistent_state, const_str("yes")) || - str_strcmp(&db_head->persistent_state, const_str("on"))) + else if (str_strcmp(&db_head->persistent_state, const_str("1")) == 0 || + str_strcmp(&db_head->persistent_state, const_str("yes")) == 0 || + str_strcmp(&db_head->persistent_state, const_str("on")) == 0) partition->persistent_state = 1; if (partition->persistent_state)