Allow compact IPv6 addresses in IP6TABLES() rules

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2017-01-07 10:01:03 -08:00
parent 1d1068ac74
commit 63d7580219
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -2000,6 +2000,21 @@ sub find_writable_file($) {
"$config_path[0]$filename"; "$config_path[0]$filename";
} }
#
# Determine if a value has been supplied
#
sub supplied( $ ) {
my $val = shift;
defined $val && $val ne '';
}
sub passed( $ ) {
my $val = shift;
defined $val && $val ne '' && $val ne '-';
}
# #
# Split a comma-separated list into a Perl array # Split a comma-separated list into a Perl array
# #
@ -2058,7 +2073,7 @@ sub split_list1( $$;$ ) {
sub split_list2( $$ ) { sub split_list2( $$ ) {
my ($list, $type ) = @_; my ($list, $type ) = @_;
fatal_error "Invalid $type ($list)" if $list =~ /^:|::/; fatal_error "Invalid $type ($list)" if $list =~ /^:/;
my @list1 = split /:/, $list; my @list1 = split /:/, $list;
my @list2; my @list2;
@ -2095,6 +2110,7 @@ sub split_list2( $$ ) {
fatal_error "Invalid $type ($list)" if $opencount < 0; fatal_error "Invalid $type ($list)" if $opencount < 0;
} }
} elsif ( $element eq '' ) { } elsif ( $element eq '' ) {
fatal_error "Invalid $type ($list)" unless supplied $_;
push @list2 , $_; push @list2 , $_;
} else { } else {
$element = join ':', $element , $_; $element = join ':', $element , $_;
@ -2260,21 +2276,6 @@ sub split_columns( $ ) {
@list2; @list2;
} }
#
# Determine if a value has been supplied
#
sub supplied( $ ) {
my $val = shift;
defined $val && $val ne '';
}
sub passed( $ ) {
my $val = shift;
defined $val && $val ne '' && $val ne '-';
}
sub clear_comment(); sub clear_comment();
# #