Commit 707bfcef authored by Robert Anderson's avatar Robert Anderson Committed by Nigel Kukard
Browse files

Fixed ipv6 source item matching

parent baab152c
......@@ -370,7 +370,7 @@ sub policySourceItemMatches
# Match IPv4 or IPv6
if (
$item =~ /^(?:\d{1,3})(?:\.(?:\d{1,3})(?:\.(?:\d{1,3})(?:\.(?:\d{1,3}))?)?)?(?:\/(\d{1,2}))?$/ ||
$item =~ /^(?:::(:?[a-f\d]{1,4}:){0,7}?|(?::[a-f\d]{1,4}){0,7}?::|(?::[a-f\d]{1,4}){0,7}?::(?:[a-f\d]{1,4}:){0,7}?)(?:\/\d{1,3})?$/i
$item =~ /^(?:::(?:[a-f\d]{1,4}:){0,6}?[a-f\d]{1,4}|[a-f\d]{1,4}(?::[a-f\d]{1,4}){0,6}?::|[a-f\d]{1,4}(?::[a-f\d]{1,4}){0,6}?::(?:[a-f\d]{1,4}:){0,6}?[a-f\d]{1,4})(?:\/\d{1,3})?$/i
) {
# See if we get an object from
my $matchRange = new awitpt::netip($item);
......@@ -385,7 +385,7 @@ sub policySourceItemMatches
# Match peer IPv4 or IPv6 (the server requesting the policy)
} elsif (
$item =~ /^\[((?:\d{1,3})(?:\.(?:\d{1,3})(?:\.(?:\d{1,3})(?:\.(?:\d{1,3}))?)?)?(?:\/(\d{1,2}))?)\]$/ ||
$item =~ /^\[((?:::(:?[a-f\d]{1,4}:){0,7}?|(?::[a-f\d]{1,4}){0,7}?::|(?::[a-f\d]{1,4}){0,7}?::(?:[a-f\d]{1,4}:){0,7}?)(?:\/\d{1,3})?)\]$/i
$item =~ /^\[((?:::(?:[a-f\d]{1,4}:){0,6}?[a-f\d]{1,4}|[a-f\d]{1,4}(?::[a-f\d]{1,4}){0,6}?::|[a-f\d]{1,4}(?::[a-f\d]{1,4}){0,6}?::(?:[a-f\d]{1,4}:){0,6}?[a-f\d]{1,4})(?:\/\d{1,3})?)\]$/i
) {
# We don't want the [ and ]
my $cleanItem = $1;
......
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