[sr-dev] git:master:2c26f8b5: modules/ipops: fix subnet matching for mask /0

murfur m.furmur at gmail.com
Mon Jul 11 21:23:36 CEST 2016


Module: kamailio
Branch: master
Commit: 2c26f8b574e1b8adb0e4fa5a6db7a54ab455ee21
URL: https://github.com/kamailio/kamailio/commit/2c26f8b574e1b8adb0e4fa5a6db7a54ab455ee21

Author: murfur <m.furmur at gmail.com>
Committer: murfur <m.furmur at gmail.com>
Date: 2016-07-11T13:24:21+03:00

modules/ipops: fix subnet matching for mask /0

---

Modified: modules/ipops/ipops_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/2c26f8b574e1b8adb0e4fa5a6db7a54ab455ee21.diff
Patch: https://github.com/kamailio/kamailio/commit/2c26f8b574e1b8adb0e4fa5a6db7a54ab455ee21.patch

---

diff --git a/modules/ipops/ipops_mod.c b/modules/ipops/ipops_mod.c
index 916a713..2f1c716 100644
--- a/modules/ipops/ipops_mod.c
+++ b/modules/ipops/ipops_mod.c
@@ -535,7 +535,7 @@ static int w_ip_is_in_subnet(struct sip_msg* _msg, char* _s1, char* _s2)
 	str string1, string2;
 	enum enum_ip_type ip1_type, ip2_type;
 	char *cidr_pos = NULL;
-	int netmask = 0;
+	int netmask = -1;
 
 	if (_s1 == NULL || _s2 == NULL ) {
 		LM_ERR("bad parameters\n");
@@ -586,7 +586,7 @@ static int w_ip_is_in_subnet(struct sip_msg* _msg, char* _s1, char* _s2)
 			break;
 	}
 
-	if (netmask == 0)
+	if (netmask == -1)
 	{
 		if (_compare_ips(string1.s, string1.len, ip1_type, string2.s, string2.len, ip2_type))
 			return 1;




More information about the sr-dev mailing list