Don't allow non-shared provider in masq file

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8182 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2008-02-11 18:40:58 +00:00
parent 00a72b0dec
commit 5c922eb2af
2 changed files with 5 additions and 3 deletions

View File

@ -189,9 +189,11 @@ sub setup_one_masq($$$$$$$)
if ( $interface =~ /(.*)[(](\w*)[)]$/ ) {
$interface = $1;
my $realm = $2;
my $provider = $2;
$fullinterface =~ s/[(]\w*[)]//;
$realm = lookup_provider( $realm ) unless $realm =~ /^\d+$/;
my $realm = lookup_provider( $provider ) unless $provider =~ /^\d+$/;
fatal_error "$provider is not a shared-interface provider" unless $realm;
$rule .= "-m realm --realm $realm ";
}

View File

@ -587,7 +587,7 @@ sub lookup_provider( $ ) {
fatal_error "Unknown provider ($provider)" unless $providerref;
$providerref->{number};
$providerref->{shared} ? $providerref->{number} : 0;
}
1;