Browse code

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

Olle E. Johansson authored on 03/04/2013 18:01:35
Showing 1 changed files
... ...
@@ -765,6 +765,11 @@ static void core_tcp_list(rpc_t* rpc, void* c)
765 765
 	struct tcp_connection* con;
766 766
 	int i, len, timeout;
767 767
 
768
+	if (tcp_disable) {
769
+		rpc->fault(c, 500, "tcp support disabled");
770
+		return;
771
+	}
772
+
768 773
 	TCPCONN_LOCK;
769 774
 	for(i = 0; i < TCP_ID_HASH_SIZE; i++) {
770 775
 		for (con = tcpconn_id_hash[i]; con; con = con->id_next) {