Module: kamailio
Branch: master
Commit: 2c26f8b574e1b8adb0e4fa5a6db7a54ab455ee21
URL:
https://github.com/kamailio/kamailio/commit/2c26f8b574e1b8adb0e4fa5a6db7a54…
Author: murfur <m.furmur(a)gmail.com>
Committer: murfur <m.furmur(a)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/2c26f8b574e1b8adb0e4fa5a6db7a54…
Patch:
https://github.com/kamailio/kamailio/commit/2c26f8b574e1b8adb0e4fa5a6db7a54…
---
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;