From 42b22b6e2d91d907cbf80b499b9e4380def2e652 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Wed, 3 Jan 2024 22:18:58 +0100 Subject: [PATCH] lcr: added module prefix to db_url global variable - safety for symbols overlapping --- src/modules/lcr/lcr_mod.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/lcr/lcr_mod.c b/src/modules/lcr/lcr_mod.c index 4f0cfae70a9..242054ebaa4 100644 --- a/src/modules/lcr/lcr_mod.c +++ b/src/modules/lcr/lcr_mod.c @@ -135,7 +135,7 @@ gen_lock_t *reload_lock; /* database variables */ /* clang-format off */ -static str db_url = str_init(DEFAULT_RODB_URL); +static str lcr_db_url = str_init(DEFAULT_RODB_URL); static str lcr_rule_table = str_init(LCR_RULE_TABLE); static str lcr_rule_target_table = str_init(LCR_RULE_TARGET_TABLE); static str lcr_gw_table = str_init(LCR_GW_TABLE); @@ -313,7 +313,7 @@ static cmd_export_t cmds[] = { * Exported parameters */ static param_export_t params[] = { - {"db_url", PARAM_STR, &db_url}, + {"db_url", PARAM_STR, &lcr_db_url}, {"lcr_rule_table", PARAM_STR, &lcr_rule_table}, {"lcr_rule_target_table", PARAM_STR, &lcr_rule_target_table}, {"lcr_gw_table", PARAM_STR, &lcr_gw_table}, @@ -455,7 +455,7 @@ static int mod_init(void) } /* Bind database */ - if(lcr_db_bind(&db_url)) { + if(lcr_db_bind(&lcr_db_url)) { LM_ERR("no database module found\n"); return -1; } @@ -692,7 +692,7 @@ static int mod_init(void) } /* Check table version */ - if(lcr_db_init(&db_url) < 0) { + if(lcr_db_init(&lcr_db_url) < 0) { LM_ERR("unable to open database connection\n"); return -1; } @@ -1484,7 +1484,7 @@ int reload_tables() request_uri_re = from_uri_re = 0; - if(lcr_db_init(&db_url) < 0) { + if(lcr_db_init(&lcr_db_url) < 0) { LM_ERR("unable to open database connection\n"); return -1; }