[sr-dev] git:master:3ba676e9: ims_ipsec_pcscf: same type for init flag variable

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


Module: kamailio
Branch: master
Commit: 3ba676e9776b8fea8e64eeb8ea7520ab83b8702c
URL: https://github.com/kamailio/kamailio/commit/3ba676e9776b8fea8e64eeb8ea7520ab83b8702c

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

ims_ipsec_pcscf: same type for init flag variable

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

---

Modified: src/modules/ims_ipsec_pcscf/cmd.c
Modified: src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3ba676e9776b8fea8e64eeb8ea7520ab83b8702c.diff
Patch: https://github.com/kamailio/kamailio/commit/3ba676e9776b8fea8e64eeb8ea7520ab83b8702c.patch

---

diff --git a/src/modules/ims_ipsec_pcscf/cmd.c b/src/modules/ims_ipsec_pcscf/cmd.c
index d48e280114..14e797c02b 100644
--- a/src/modules/ims_ipsec_pcscf/cmd.c
+++ b/src/modules/ims_ipsec_pcscf/cmd.c
@@ -67,7 +67,7 @@ extern ip_addr_t ipsec_listen_ip_addr6;
 
 extern int spi_id_start;
 
-extern unsigned int init_flag;
+extern unsigned int ipsec_init_flag;
 
 // check http://www.asipto.com/pub/kamailio-devel-guide/#c16return_values
 const int IPSEC_CMD_FAIL = -1;
@@ -90,7 +90,7 @@ int bind_ipsec_pcscf(ipsec_pcscf_api_t *api)
 		LM_ERR("invalid parameter value\n");
 		return -1;
 	}
-	if(init_flag == 0) {
+	if(ipsec_init_flag == 0) {
 		LM_ERR("configuration error - trying to bind to ipsec pscscf module "
 			   "before being initialized\n");
 		return -1;
diff --git a/src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c b/src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c
index b088a8af7f..20e5e1c97b 100644
--- a/src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c
+++ b/src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c
@@ -65,7 +65,7 @@ static int free_uint_fixup(void **param, int param_no);
 
 extern int bind_ipsec_pcscf(usrloc_api_t *api);
 
-int init_flag = 0;
+unsigned int ipsec_init_flag = 0;
 
 /* clang-format off */
 
@@ -363,7 +363,7 @@ static int mod_init(void)
 		return -1;
 	}
 
-	init_flag = 1;
+	ipsec_init_flag = 1;
 
 	return 0;
 }




More information about the sr-dev mailing list