[sr-dev] git:master: lib/kmi: safety re-entrant call of init_mi_child()

Daniel-Constantin Mierla miconda at gmail.com
Fri Sep 30 13:30:48 CEST 2011


Module: sip-router
Branch: master
Commit: 0e5fc52895a67818c8559bcc673238b766e70445
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0e5fc52895a67818c8559bcc673238b766e70445

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Fri Sep 30 13:29:15 2011 +0200

lib/kmi: safety re-entrant call of init_mi_child()

- otherwise can get to a loop of trying, reported by Juha Heinanen

---

 lib/kmi/mi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/kmi/mi.c b/lib/kmi/mi.c
index 395b8ee..662de88 100644
--- a/lib/kmi/mi.c
+++ b/lib/kmi/mi.c
@@ -106,6 +106,7 @@ int init_mi_child(void)
 
 	if(mi_commands_initialized)
 		return 0;
+	mi_commands_initialized = 1;
 	for ( i=0 ; i<mi_cmds_no ; i++ ) {
 		if ( mi_cmds[i].init_f && mi_cmds[i].init_f()!=0 ) {
 			LM_ERR("failed to init <%.*s>\n",
@@ -120,7 +121,6 @@ int init_mi_child(void)
 			return -1;
 		}
 	}
-	mi_commands_initialized = 1;
 	return 0;
 }
 




More information about the sr-dev mailing list