forked from extern/shorewall_code
Allow multiple protocols to be specified for a helper
- the protocol list is specified in the %helpers hash as an array reference e.g., "[UDP,TCP]". Note that those are protocol *numbers*, not names. Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
aa97b1b283
commit
2f66381a4a
@ -5747,10 +5747,25 @@ sub validate_helper( $;$ ) {
|
||||
|
||||
my $protonum = -1;
|
||||
|
||||
fatal_error "Unknown PROTO ($proto)" unless defined ( $protonum = resolve_proto( $proto ) );
|
||||
fatal_error "Unknown PROTO ($proto)" unless $proto eq '-' || defined ( $protonum = resolve_proto( $proto ) );
|
||||
|
||||
unless ( $protonum == $helper_proto ) {
|
||||
fatal_error "The $helper_base helper requires PROTO=" . (proto_name $helper_proto );
|
||||
if ( reftype( $helper_proto ) ) {
|
||||
#
|
||||
# More than one protocol allowed with this helper, so $helper_proto is an array reference
|
||||
#
|
||||
my $found;
|
||||
my $names = '';
|
||||
|
||||
for ( @$helper_proto ) {
|
||||
$names = $names ? join( ',', $names, proto_name( $_ ) ) : proto_name( $_ );
|
||||
$found = 1 if $protonum == $_;
|
||||
}
|
||||
|
||||
fatal_error "The $helper_base helper requires PROTO to be one of '$names'" unless $found;
|
||||
} else {
|
||||
unless ( $protonum == $helper_proto ) {
|
||||
fatal_error "The $helper_base helper requires PROTO=" . (proto_name( $helper_proto ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user