From 8a8214704e92fcb41db3763f9aeacf68109dc94a Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 27 Dec 2011 13:04:19 -0800 Subject: [PATCH] Centralize checking for required proto with helper Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 4 +--- Shorewall/Perl/Shorewall/Raw.pm | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index a42582f0f..e2bd02534 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -4018,9 +4018,7 @@ sub validate_helper( $;$ ) { if ( supplied $proto ) { my $protonum = -1; - unless ( $proto eq '-' ) { - fatal_error "Unknown PROTO ($protonum)" unless defined ( $protonum = resolve_proto( $proto ) ); - } + fatal_error "Unknown PROTO ($protonum)" unless defined ( $protonum = resolve_proto( $proto ) ); unless ( $protonum == $helper_proto ) { fatal_error "The $helper_base helper requires PROTO=" . (proto_name $helper_proto ); diff --git a/Shorewall/Perl/Shorewall/Raw.pm b/Shorewall/Perl/Shorewall/Raw.pm index af70825f1..35932c756 100644 --- a/Shorewall/Perl/Shorewall/Raw.pm +++ b/Shorewall/Perl/Shorewall/Raw.pm @@ -76,7 +76,6 @@ sub process_notrack_rule( $$$$$$$ ) { if ( $option eq 'helper' ) { fatal_error "Invalid helper' ($args)" if $args =~ /,/; - fatal_error "A protocol protocol is required in CT:helper rules" if $proto eq '-'; validate_helper( $args, $proto ); $action = "CT --helper $args"; $exception_rule = do_proto( $proto, '-', '-' );