From 8ab45b4de388cd0ed6b0fe1a60edd19cd08e4874 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 1 Jul 2011 16:21:36 -0700 Subject: [PATCH] Save current action chain along with params. Add get_action_chain() Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 9 +++++++-- Shorewall/Perl/Shorewall/Rules.pm | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 664b0da3a..e23588498 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -1800,13 +1800,14 @@ sub embedded_perl( $ ) { # # Push/pop action params # -sub push_action_params( $ ) { - my @params = split /,/, $_[0]; +sub push_action_params( $$ ) { + my @params = split /,/, $_[1]; my $oldparams = \@actparms; my $params = @params; @actparms = (); + $actparms[0] = $_[0]; @actparms[1..$params] = @params; $oldparams; @@ -1835,6 +1836,10 @@ sub get_action_params( $ ) { @actparms[1..$num]; } +sub get_actionchain() { + $actparms[0]; +} + sub set_action_param( $$ ) { my $i = shift; diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index 4fd647440..6ff1ef848 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -1465,7 +1465,7 @@ sub process_action( $) { push_open $actionfile; - my $oldparms = push_action_params( $param ); + my $oldparms = push_action_params( $chainref, $param ); $active{$wholeaction}++; push @actionstack, $wholeaction;