sub parse_fw_rule {
my ($prefix, $line, $cluster_conf, $fw_conf, $rule_env, $verbose) = @_;
- chomp $line;
-
my $orig_line = $line;
my $rule = {};
$opt = lc($1);
$value = $2;
} else {
- chomp $line;
die "can't parse option '$line'\n"
}
$opt = lc($1);
$value = int($2);
} else {
- chomp $line;
die "can't parse option '$line'\n"
}
$opt = lc($1);
$value = uc($3);
} else {
- chomp $line;
die "can't parse option '$line'\n"
}
next if $line =~ m/^#/;
next if $line =~ m/^\s*$/;
+ chomp $line;
+
my $linenr = $fh->input_line_number();
my $prefix = "$filename (line $linenr)";
}
};
if (my $err = $@) {
+ chomp $err;
$errors->{cidr} = $err;
}
$entry->{comment} = $comment if $comment;
$entry->{errors} = $errors if $errors;
+ if ($verbose && $errors) {
+ warn "$prefix - errors in ipset: $line\n";
+ foreach my $p (keys %{$errors}) {
+ warn " $p: $errors->{$p}\n";
+ }
+ }
+
push @{$res->{$section}->{$group}}, $entry;
} else {
warn "$prefix: skip line - unknown section\n";
# remove duplicates
my $nethash = {};
foreach my $entry (@$options) {
+ next if $entry->{errors}; # skip entries with errors
eval {
my $cidr = resolve_alias($clusterfw_conf, $fw_conf, $entry->{cidr});
$nethash->{$cidr} = { cidr => $cidr, nomatch => $entry->{nomatch} };