Commit 8d1e3387 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Make the CIDR value for IP specifications optional, an IP without it now defaults to /32

parent 660561ba
......@@ -310,7 +310,7 @@ sub policySourceItemMatches
my $res = 0;
# Match IP
if ($item =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?:\/\d{1,2})$/) {
if ($item =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?:\/\d{1,2})?$/) {
$res = ipMatches($sessionData->{'ClientAddress'},$item);
$server->log(LOG_DEBUG,"[POLICIES] $debugTxt: - Resolved source '$item' to a IP/CIDR specification, match = $res") if ($log);
......@@ -429,7 +429,7 @@ sub ipMatches
# Pull off parts of IP
my ($cidr_address,$cidr_mask) = ($cidr =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\/(\d{1,2}))$/);
my ($cidr_address,$cidr_mask) = ($cidr =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\/(\d{1,2}))?$/);
# Pull long for IP we going to test
my $ip_long = ip_to_long($ip);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment