diff options
Diffstat (limited to 'lib/Vyatta')
-rwxr-xr-x | lib/Vyatta/IpTables/IpSet.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Vyatta/IpTables/IpSet.pm b/lib/Vyatta/IpTables/IpSet.pm index e28c5e4..80e20bb 100755 --- a/lib/Vyatta/IpTables/IpSet.pm +++ b/lib/Vyatta/IpTables/IpSet.pm @@ -157,10 +157,23 @@ sub check_member { if (!Vyatta::TypeChecker::validateType('ipv4', $member, 1)) { return "Error: [$member] isn't valid IPv4 address\n"; } + if ($member eq '0.0.0.0') { + return "Error: zero IP address not valid in address-group\n"; + } } elsif ($self->{_type} eq 'network') { if (!Vyatta::TypeChecker::validateType('ipv4net', $member, 1)) { return "Error: [$member] isn't valid IPv4 network\n"; } + if ($member =~ /([\d.]+)\/(\d+)/) { + my $net = $1; + my $cidr = $2; + return "Error: zero net invalid in network-group\n" + if $net eq '0.0.0.0'; + return "Error: zero cidr invalid in network-group\n" + if $cidr eq '0'; + } else { + return "Error: Invalid network group [$member]\n"; + } } elsif ($self->{_type} eq 'port') { if ($member =~ /^\d/) { my ($success, $err) = Vyatta::Misc::isValidPortNumber($member); |