On 12/1/12 11:09 AM, Tom Eastep wrote:
> On 12/1/12 9:32 AM, Mr Dash Four wrote:
>> I've just finished testing this release and found the following issues:
>>
>> 1. Actions/SWITCH naming conventions
>>
>> actions
>> ~~~~~~~
>> C_ACTION inline
>> fw2net # this action is not inline!
>>
>> action.fw2net
>> ~~~~~~~~~~~~~
>> LOG:info ; switch:${0}_action
>>
>> action.C_ACTION
>> ~~~~~~~~~~~~~~~
>> LOG:info ; switch:${0}_c_action
> 
> You are using ${0} -- if you use @{0} then it works (but you will need
> to wait until RC 1; in Beta3, just use @).
> 
> Within a SWITCH, @{0} (@ in Beta 3) expands to the name of the current
> chain with non-alphanumeric characters except '_' and '-' suppressed.
> ${0} always expands to the full name of the chain.
> 
>>
>> rules
>> ~~~~~
>> fw2net $FW net
>>
>> results in "ERROR: Invalid switch name (%fw2net_action)" message
>>
>> Further to this, if I add the following:
>>
>> blrules
>> ~~~~~~~
>> C_ACTION:info all all
>>
>> I get "ERROR: Invalid switch name (fw2net~_c_action)"
> 
> Same issue.
> 
>>
>> 2. action.template needs to be updated to include the SWITCH column
> 
> Updated; thanks
> 
>>
>> 3. Action circular reference undetected and/or error message displayed 
>> incomplete/wrong:
>>
>> action.circ1
>> ~~~~~~~~~~~~
>> $1
>>
>> rules
>> ~~~~~
>> circ1(circ1):info $FW net
>>
>> Gets me "ERROR: Undefined parameter ($1)"
> 
> You are not getting far enough for the recursion to be discovered. If
> you change:
> 
> action.circ1
> ^^^^^^^^^^^^
> $1($1)
> 
> Then you get
> 
> ERROR: Action circ1 invoked Recursively
>        (circ1(circ1):info->circ1(circ1):info)
> 
> The way you have coded the action, you are invoking circ1 with no
> parameters; as a result, expansion of $1 fails in the pre-processor.
> 
>>

I took another look at this and I'm able to do something about it.

Patch attached.

-Tom


-- 
Tom Eastep        \ When I die, I want to go like my Grandfather who
Shoreline,         \ died peacefully in his sleep. Not screaming like
Washington, USA     \ all of the passengers in his car
http://shorewall.net \________________________________________________
diff --git a/Shorewall/Perl/Shorewall/Rules.pm 
b/Shorewall/Perl/Shorewall/Rules.pm
index 2e27b1e..a6e31e9 100644
--- a/Shorewall/Perl/Shorewall/Rules.pm
+++ b/Shorewall/Perl/Shorewall/Rules.pm
@@ -1554,7 +1554,7 @@ sub process_action( $) {
 
        my $oldparms = push_action_params( $chainref, $param );
 
-       $active{$wholeaction}++;
+       $active{$action}++;
        push @actionstack, $wholeaction;
 
        push_comment( '' );
@@ -1612,7 +1612,7 @@ sub process_action( $) {
 
        pop_comment;
 
-       $active{$wholeaction}--;
+       $active{$action}--;
        pop @actionstack;
 
        pop_open;
@@ -2029,7 +2029,7 @@ sub process_rule1 ( $$$$$$$$$$$$$$$$$$ ) {
        #
        $normalized_target = normalize_action( $basictarget, $loglevel, $param 
);
 
-       fatal_error( "Action $basictarget invoked Recursively (" .  join( '->', 
map( externalize( $_ ), @actionstack , $normalized_target ) ) . ')' ) if 
$active{$normalized_target};
+       fatal_error( "Action $basictarget invoked Recursively (" .  join( '->', 
map( externalize( $_ ), @actionstack , $normalized_target ) ) . ')' ) if 
$active{$basictarget};
 
        if ( my $ref = use_action( $normalized_target ) ) {
            #

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to