summaryrefslogtreecommitdiff
path: root/lib/Vyatta/IpTables
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2009-01-26 17:43:33 -0800
committerBob Gilligan <gilligan@vyatta.com>2009-01-26 17:43:33 -0800
commit42608bdd761488bac5250371e98b91ec44c0b4ca (patch)
treecde03d094879dbabd27ed3f5ed11b2ab807c6fba /lib/Vyatta/IpTables
parent032ed4f9bbb17c82fa618c0180e8009e25d44bae (diff)
downloadvyatta-cfg-firewall-42608bdd761488bac5250371e98b91ec44c0b4ca.tar.gz
vyatta-cfg-firewall-42608bdd761488bac5250371e98b91ec44c0b4ca.zip
Add support for IPv6 address ranges.
Diffstat (limited to 'lib/Vyatta/IpTables')
-rwxr-xr-xlib/Vyatta/IpTables/AddressFilter.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Vyatta/IpTables/AddressFilter.pm b/lib/Vyatta/IpTables/AddressFilter.pm
index 6a74002..fe17c09 100755
--- a/lib/Vyatta/IpTables/AddressFilter.pm
+++ b/lib/Vyatta/IpTables/AddressFilter.pm
@@ -156,6 +156,7 @@ sub rule {
my $addr_checker;
my $prefix_checker;
+ my $pure_addr_checker;
my $ip_term;
my $prefix_term;
@@ -164,6 +165,7 @@ sub rule {
$addr_checker = 'ipv4_negate';
$prefix_checker = 'ipv4net_negate';
+ $pure_addr_checker = 'ipv4';
$ip_term = "IPv4";
$prefix_term = "subnet";
} elsif ($self->{_ip_version} eq "ipv6") {
@@ -171,6 +173,7 @@ sub rule {
$addr_checker = 'ipv6_negate';
$prefix_checker = 'ipv6net_negate';
+ $pure_addr_checker = 'ipv6';
$ip_term = "IPv6";
$prefix_term = "prefix"
} else {
@@ -203,12 +206,11 @@ sub rule {
$str =~ s/^\!(.*)$/! $1/;
$rule .= "--$self->{_srcdst} $str ";
} elsif ((defined $self->{_range_start}) && (defined $self->{_range_stop})) {
- # Ranges are supported for IPv4 only
my $start = $self->{_range_start};
my $stop = $self->{_range_stop};
return (undef, "\"$start-$stop\" is not a valid IP range")
- if (!Vyatta::TypeChecker::validateType('ipv4_negate', $start, 1)
- || !Vyatta::TypeChecker::validateType('ipv4', $stop, 1));
+ if (!Vyatta::TypeChecker::validateType($addr_checker, $start, 1)
+ || !Vyatta::TypeChecker::validateType($pure_addr_checker, $stop, 1));
my $negate = '';
if ($self->{_range_start} =~ /^!(.*)$/) {
$start = $1;