[sr-dev] git:master:61b175bc: ims_usrloc_scscf: same type for init flag variable

Daniel-Constantin Mierla miconda at gmail.com
Mon May 30 13:20:12 CEST 2022


Module: kamailio
Branch: master
Commit: 61b175bcffed9492d6cc718c9ac70c4378712807
URL: https://github.com/kamailio/kamailio/commit/61b175bcffed9492d6cc718c9ac70c4378712807

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-05-30T13:19:40+02:00

ims_usrloc_scscf: same type for init flag variable

- it was defined as int but the extern declaration was unsigned
- added ims_ulp_ prefix to avoid global scope conflict with other modules

---

Modified: src/modules/ims_usrloc_scscf/ims_usrloc_scscf_mod.c
Modified: src/modules/ims_usrloc_scscf/usrloc.c

---

Diff:  https://github.com/kamailio/kamailio/commit/61b175bcffed9492d6cc718c9ac70c4378712807.diff
Patch: https://github.com/kamailio/kamailio/commit/61b175bcffed9492d6cc718c9ac70c4378712807.patch

---

diff --git a/src/modules/ims_usrloc_scscf/ims_usrloc_scscf_mod.c b/src/modules/ims_usrloc_scscf/ims_usrloc_scscf_mod.c
index bb5c394704..1a82d6bcc8 100644
--- a/src/modules/ims_usrloc_scscf/ims_usrloc_scscf_mod.c
+++ b/src/modules/ims_usrloc_scscf/ims_usrloc_scscf_mod.c
@@ -116,7 +116,7 @@ str db_url          = str_init(DEFAULT_DB_URL);	/*!< Database URL */
 
 /* flags */
 unsigned int nat_bflag = (unsigned int)-1;
-unsigned int init_flag = 0;
+unsigned int ims_uls_init_flag = 0;
 
 ims_dlg_api_t dlgb;
 
@@ -380,7 +380,7 @@ static int mod_init(void) {
 		nat_bflag = 1 << nat_bflag;
 	}
 
-	init_flag = 1;
+	ims_uls_init_flag = 1;
         
 	/* From contact_dlg_handlers.c
          * 
diff --git a/src/modules/ims_usrloc_scscf/usrloc.c b/src/modules/ims_usrloc_scscf/usrloc.c
index 068d9f69f2..06a082ebaa 100644
--- a/src/modules/ims_usrloc_scscf/usrloc.c
+++ b/src/modules/ims_usrloc_scscf/usrloc.c
@@ -55,7 +55,7 @@
 /*! nat branch flag */
 extern unsigned int nat_bflag;
 /*! flag to protect against wrong initialization */
-extern unsigned int init_flag;
+extern unsigned int ims_uls_init_flag;
 
 /*!
  * \brief usrloc module API export bind function
@@ -67,7 +67,7 @@ int bind_usrloc(usrloc_api_t* api) {
 		LM_ERR("invalid parameter value\n");
 		return -1;
 	}
-	if (init_flag == 0) {
+	if (ims_uls_init_flag == 0) {
 		LM_ERR("configuration error - trying to bind to usrloc module"
 				" before being initialized\n");
 		return -1;




More information about the sr-dev mailing list