mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-15 20:24:09 +01:00
Centralize checking for required proto with helper
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
aa743f2886
commit
8a8214704e
@ -4018,9 +4018,7 @@ sub validate_helper( $;$ ) {
|
|||||||
if ( supplied $proto ) {
|
if ( supplied $proto ) {
|
||||||
my $protonum = -1;
|
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 ) {
|
unless ( $protonum == $helper_proto ) {
|
||||||
fatal_error "The $helper_base helper requires PROTO=" . (proto_name $helper_proto );
|
fatal_error "The $helper_base helper requires PROTO=" . (proto_name $helper_proto );
|
||||||
|
@ -76,7 +76,6 @@ sub process_notrack_rule( $$$$$$$ ) {
|
|||||||
|
|
||||||
if ( $option eq 'helper' ) {
|
if ( $option eq 'helper' ) {
|
||||||
fatal_error "Invalid helper' ($args)" if $args =~ /,/;
|
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 );
|
validate_helper( $args, $proto );
|
||||||
$action = "CT --helper $args";
|
$action = "CT --helper $args";
|
||||||
$exception_rule = do_proto( $proto, '-', '-' );
|
$exception_rule = do_proto( $proto, '-', '-' );
|
||||||
|
Loading…
Reference in New Issue
Block a user