summaryrefslogtreecommitdiff
path: root/lib/Vyatta/IpTables
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/IpTables')
-rwxr-xr-xlib/Vyatta/IpTables/IpSet.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Vyatta/IpTables/IpSet.pm b/lib/Vyatta/IpTables/IpSet.pm
index 80e20bb..f6452d9 100755
--- a/lib/Vyatta/IpTables/IpSet.pm
+++ b/lib/Vyatta/IpTables/IpSet.pm
@@ -165,12 +165,11 @@ sub check_member {
return "Error: [$member] isn't valid IPv4 network\n";
}
if ($member =~ /([\d.]+)\/(\d+)/) {
- my $net = $1;
- my $cidr = $2;
+ my ($net, $mask) = ($1, $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';
+ return "Error: invalid mask [$mask] - must be between 1-31\n"
+ if $mask < 1 or $mask > 31;
} else {
return "Error: Invalid network group [$member]\n";
}