Correct default action handling:

- isolate basic target before testing for action/inline
- delete the action chain if appropriate.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-02-10 09:00:13 -08:00
parent f9dc89dc61
commit 54c43396f0

View File

@ -672,7 +672,9 @@ sub policy_rules( $$$$$ ) {
if ( $default && $default ne 'none' ) { if ( $default && $default ne 'none' ) {
my ( $action ) = split ':', $default; my ( $action ) = split ':', $default;
if ( ( $targets{$action} || 0 ) == INLINE ) { my ( $basicaction, $param ) = get_target_param $action;
if ( ( $targets{$basicaction} || 0 ) == INLINE ) {
# #
# Default action is an inline # Default action is an inline
# #
@ -1762,9 +1764,8 @@ sub process_action($$) {
# #
sub use_policy_action( $$ ) { sub use_policy_action( $$ ) {
my $ref = use_action( $_[0] ); my $ref = use_action( $_[0] );
if ( $ref ) { if ( $ref ) {
process_action( $ref, $_[1] ); delete $usedactions{$ref->{action}} if process_action( $ref, $_[1] );
} else { } else {
$ref = $usedactions{$_[0]}; $ref = $usedactions{$_[0]};
} }