On 11/27/2012 06:31 AM, Mr Dash Four wrote:

I will expand @{....} first; then any leftover '@' characters will be
expanded to ${chain}.


Given that $0 (and ${0}) expand to the chain name in macros and actions, it seems reasonable to adopt @{0} rather than simply '@'. Beta 3 implements the simple '@' replacement (not documented in the release notes) but I think I'll change it if there are no objections.

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/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm
index e02268f..94b99a0 100644
--- a/Shorewall/Perl/Shorewall/Chains.pm
+++ b/Shorewall/Perl/Shorewall/Chains.pm
@@ -4654,9 +4654,9 @@ sub do_condition( $$ ) {
 
     require_capability 'CONDITION_MATCH', 'A non-empty SWITCH column', 's';
 
-    if ( $condition =~ /@/ ) {
+    if ( $condition =~ /\@\{0\}/ ) {
 	$chain     =~ s/[^\w-]//g;
-	$condition =~ s/@/$chain/g;
+	$condition =~ s/\@\{0\}/$chain/g;
     }
 
     fatal_error "Invalid switch name ($condition)" unless $condition =~ /^[a-zA-Z][-\w]*$/ && length $condition <= 30;
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_______________________________________________
Shorewall-devel mailing list
Shorewall-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to