Allow a port number to be appended to a helper name

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2011-12-17 17:08:24 -08:00
parent 1f051314b3
commit a80b46be81
2 changed files with 7 additions and 3 deletions

View File

@ -4002,9 +4002,13 @@ sub do_helper( $ ) {
return '' if $helper eq '-';
warning_message "Unrecognized helper ($helper)" unless $helpers{$helper};
my $helper_base = $helper;
qq(-m helper --helper "$helper" );
$helper_base =~ s/-\d+$//;
warning_message "Unrecognized helper ($helper)" unless $helpers{$helper_base};
qq(-m helper --helper "$helper" ) if defined wantarray;
}
#

View File

@ -76,7 +76,7 @@ sub process_notrack_rule( $$$$$$$ ) {
if ( $option eq 'helper' ) {
fatal_error "Invalid helper' ($args)" if $args =~ /,/;
warning_message "Unrecognized helper ($args)" unless $helpers{$args};
do_helper( $args );
$action = "CT --helper $args";
} elsif ( $option eq 'ctevents' ) {
for ( split ',', $args ) {