Tweak the process_action() changes

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-01-17 17:03:46 -08:00
parent ec6c233666
commit a945b3e0dd

View File

@ -1799,45 +1799,43 @@ sub process_action(\$\$$) {
# were modified (and this function returns true # were modified (and this function returns true
# #
if ( my $result = pop_action_params( $oldparms ) ) { if ( my $result = pop_action_params( $oldparms ) ) {
if ( $result & PARMSMODIFIED ) { #
return PARMSMODIFIED; # Modified parameters trumps USEDCALLER
#
return PARMSMODIFIED if $result & PARMSMODIFIED;
#
# The chain uses @CALLER but doesn't modify the action parameters.
# We need to see if this chain has already called this action
#
my $renormalized_action = insert_caller( $wholeaction, $caller );
my $chain1ref = $usedactions{$renormalized_action};
if ( $chain1ref ) {
#
# It has -- use the prior chain
#
${$chainrefref} = $chain1ref;
#
# We leave the new chain in place but delete it from %usedactions below
#
} else { } else {
# #
# The chain uses @CALLER but doesn't modify the action parameters. # This is the first time that the current chain has invoked this action
# We need to see if this chain has already called this action
# #
my $renormalized_action = insert_caller( $wholeaction, $caller ); $usedactions{$renormalized_action} = $chainref;
my $chain1ref = $usedactions{$renormalized_action};
if ( $chain1ref ) {
#
# It has -- use the prior chain
#
${$chainrefref} = $chain1ref;
#
# We leave the new chain in place but delete it from %usedactions below
#
} else {
#
# This is the first time that the current chain has invoked this action
#
$usedactions{$renormalized_action} = $chainref;
#
# Swap the action member
#
$chainref->{action} = $renormalized_action;
}
# #
# Delete the usedactions entry with the original normalized key # Swap the action member
# #
delete $usedactions{$wholeaction}; $chainref->{action} = $renormalized_action;
#
# New normalized target
#
${$wholeactionref} = $renormalized_action;
return 0;
} }
#
# Delete the usedactions entry with the original normalized key
#
delete $usedactions{$wholeaction};
#
# New normalized target
#
${$wholeactionref} = $renormalized_action;
} }
0; 0;