Detect too many parameters to Drop and Reject

This commit is contained in:
Tom Eastep 2011-06-25 10:38:01 -07:00
parent 67b8a10879
commit 713af61380
2 changed files with 8 additions and 4 deletions

View File

@ -33,13 +33,15 @@
###############################################################################
FORMAT 2
#
# The following magic provides different defaults for $2 and $3, when $1 is
# The following magic provides different defaults for $2 thru $5, when $1 is
# 'audit'.
#
BEGIN PERL
use Shorewall::Config;
my ( $p1, $p2, $p3 , $p4, $p5 ) = get_action_params( 5 );
my ( $p1, $p2, $p3 , $p4, $p5, $p6 ) = get_action_params( 6 );
fatal_error "Too many parameters to Drop" if defined $p6;
if ( defined $p1 && $p1 eq 'audit' ) {
set_action_param( 2, 'A_REJECT') unless defined( $p2 ) && $p2 ne '-';

View File

@ -29,13 +29,15 @@
###############################################################################
FORMAT 2
#
# The following magic provides different defaults for $2 and $3, when $1 is
# The following magic provides different defaults for $2 thru $5, when $1 is
# 'audit'.
#
BEGIN PERL
use Shorewall::Config;
my ( $p1, $p2, $p3, $p4, $p5 ) = get_action_params( 5 );
my ( $p1, $p2, $p3 , $p4, $p5, $p6 ) = get_action_params( 6 );
fatal_error "Too many parameters to Reject" if defined $p6;
if ( defined $p1 && $p1 eq 'audit' ) {
set_action_param( 2, 'A_REJECT') unless defined( $p2 ) && $p2 ne '-';