From 2c26f8b574e1b8adb0e4fa5a6db7a54ab455ee21 Mon Sep 17 00:00:00 2001 From: murfur Date: Mon, 11 Jul 2016 13:24:21 +0300 Subject: [PATCH] modules/ipops: fix subnet matching for mask /0 --- modules/ipops/ipops_mod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ipops/ipops_mod.c b/modules/ipops/ipops_mod.c index 916a7130d06..2f1c71611c5 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;