[sr-dev] git:5.4:550840b4: pipelimit: use unsigned to compute size and for iterator

Daniel-Constantin Mierla miconda at gmail.com
Fri Oct 23 11:09:23 CEST 2020


Module: kamailio
Branch: 5.4
Commit: 550840b4b9ce8df9acdf875f907ce86533fea43e
URL: https://github.com/kamailio/kamailio/commit/550840b4b9ce8df9acdf875f907ce86533fea43e

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-10-23T10:55:52+02:00

pipelimit: use unsigned to compute size and for iterator

(cherry picked from commit 23818fb34d09a487654ea89c9f29b880c0c75197)

---

Modified: src/modules/pipelimit/pl_statistics.c

---

Diff:  https://github.com/kamailio/kamailio/commit/550840b4b9ce8df9acdf875f907ce86533fea43e.diff
Patch: https://github.com/kamailio/kamailio/commit/550840b4b9ce8df9acdf875f907ce86533fea43e.patch

---

diff --git a/src/modules/pipelimit/pl_statistics.c b/src/modules/pipelimit/pl_statistics.c
index e1afa2ffb8..0c6c52d389 100644
--- a/src/modules/pipelimit/pl_statistics.c
+++ b/src/modules/pipelimit/pl_statistics.c
@@ -137,10 +137,12 @@ int get_socket_list_from_proto_and_family(int **ipList, int protocol, int family
 	struct socket_info  *si;
 	struct socket_info** list;
 
-	int num_ip_octets   = family == AF_INET ? NUM_IP_OCTETS : NUM_IPV6_OCTETS;
-	int numberOfSockets = 0;
+	unsigned int num_ip_octets   = 0;
+	unsigned int numberOfSockets = 0;
 	int currentRow      = 0;
 
+	num_ip_octets = (family == AF_INET) ? NUM_IP_OCTETS : NUM_IPV6_OCTETS;
+
 	/* I hate to use #ifdefs, but this is necessary because of the way
 	 * get_sock_info_list() is defined.  */
 #ifndef USE_TCP
@@ -198,7 +200,7 @@ int get_socket_list_from_proto_and_family(int **ipList, int protocol, int family
 
 	/* Extract out the IP Addresses and ports.  */
 	for(si=list?*list:0; si; si=si->next){
-		int i;
+		unsigned int i;
 
 		/* We currently only support IPV4. */
 		if (si->address.af != family) {




More information about the sr-dev mailing list