[sr-dev] git:master: core Make sure Kamailio doesn' t crash if TCP is disabled and RPC core.tcp_list RPC command is issued

Olle E. Johansson oej at edvina.net
Wed Apr 3 20:22:34 CEST 2013


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

Author: Olle E. Johansson <oej at edvina.net>
Committer: Olle E. Johansson <oej at edvina.net>
Date:   Wed Apr  3 20:01:35 2013 +0200

core Make sure Kamailio doesn't crash if TCP is disabled and RPC core.tcp_list RPC command is issued

---

 core_cmd.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/core_cmd.c b/core_cmd.c
index 9914737..6a889dd 100644
--- a/core_cmd.c
+++ b/core_cmd.c
@@ -765,6 +765,11 @@ static void core_tcp_list(rpc_t* rpc, void* c)
 	struct tcp_connection* con;
 	int i, len, timeout;
 
+	if (tcp_disable) {
+		rpc->fault(c, 500, "tcp support disabled");
+		return;
+	}
+
 	TCPCONN_LOCK;
 	for(i = 0; i < TCP_ID_HASH_SIZE; i++) {
 		for (con = tcpconn_id_hash[i]; con; con = con->id_next) {




More information about the sr-dev mailing list