Improve error message

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-10-05 11:25:18 -07:00
parent 587dacdae0
commit 7767d30c7c

View File

@ -3253,7 +3253,6 @@ sub have_global_variables() {
# #
# Generate setting of run-time global shell variables # Generate setting of run-time global shell variables
# #
sub set_global_variables( $ ) { sub set_global_variables( $ ) {
my $setall = shift; my $setall = shift;
@ -3308,8 +3307,8 @@ sub handle_network_exclusion( $;$ ) {
# #
# Split a network element into the net part and exclusion part (if any) # Split a network element into the net part and exclusion part (if any)
# #
sub split_network( $$ ) { sub split_network( $$$ ) {
my ( $input, $srcdst) = @_; my ( $input, $srcdst, $list ) = @_;
my @input = split '!', $input; my @input = split '!', $input;
my @result; my @result;
@ -3333,7 +3332,7 @@ sub split_network( $$ ) {
@result = @input; @result = @input;
} }
fatal_error "Invalid $srcdst element ($input)" if @result > 2; fatal_error "Invalid $srcdst ($list)" if @result > 2;
@result; @result;
} }
@ -3356,7 +3355,7 @@ sub handle_network_list( $$ ) {
$excl = handle_network_exclusion $1, ''; $excl = handle_network_exclusion $1, '';
} else { } else {
fatal_error "Invalid $srcdst ($list)" if $excl; fatal_error "Invalid $srcdst ($list)" if $excl;
my ( $temp1, $temp2 ) = split_network $_, $srcdst; my ( $temp1, $temp2 ) = split_network $_, $srcdst, $list;
$nets = $nets ? join(',', $nets, $temp1 ) : $temp1; $nets = $nets ? join(',', $nets, $temp1 ) : $temp1;
$excl = handle_network_exclusion $temp2 if $temp2; $excl = handle_network_exclusion $temp2 if $temp2;
} }