Parcourir la source

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]>
Lennart Rosam il y a 9 mois
Parent
commit
785659417b
1 fichiers modifiés avec 7 ajouts et 2 suppressions
  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

@@ -364,6 +364,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) {
@@ -371,7 +372,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");
@@ -383,7 +386,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;
 	}