Explorar o código

ims_ipsec_pcscf: Add error logging

Currently the module initialization fails when the ipsec listen
interfaces cannot be bound and it does not produce a helpful log message
for the user. This commit addresses that.

Co-authored-by: Alexander Couzens <[email protected]>
(cherry picked from commit 785659417bcc1984f12d5ebe35c134b15d614483)
Lennart Rosam hai 9 meses
pai
achega
0363fe3f33
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c

+ 7 - 2
src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c

@@ -336,6 +336,7 @@ static int ipsec_add_listen_ifaces()
 static int mod_init(void)
 {
 	bind_usrloc_t bind_usrloc;
+	int ret;
 
 	bind_usrloc = (bind_usrloc_t)find_export("ul_bind_ims_usrloc_pcscf", 1, 0);
 	if(!bind_usrloc) {
@@ -343,7 +344,9 @@ static int mod_init(void)
 		return -1;
 	}
 
-	if(bind_usrloc(&ul) < 0) {
+	ret = bind_usrloc(&ul);
+	if(ret < 0) {
+		LM_ERR("bind_userloc() has failed with code %d", ret);
 		return -1;
 	}
 	LM_INFO("Successfully bound to PCSCF Usrloc module\n");
@@ -355,7 +358,9 @@ static int mod_init(void)
 	}
 	LM_INFO("Successfully bound to TM module\n");
 
-	if(ipsec_add_listen_ifaces() != 0) {
+	ret = ipsec_add_listen_ifaces();
+	if(ret != 0) {
+		LM_ERR("Failed to add ipsec listen interface. Code: %d", ret);
 		return -1;
 	}