Centralize checking for required proto with helper

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2011-12-27 13:04:19 -08:00
parent aa743f2886
commit 8a8214704e
2 changed files with 1 additions and 4 deletions

View File

@ -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 );

View File

@ -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, '-', '-' );