Improve check for shared-interface provider

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8183 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2008-02-11 18:52:49 +00:00
parent 5c922eb2af
commit 7067a3d53d

View File

@ -585,7 +585,21 @@ sub lookup_provider( $ ) {
my $provider = $_[0]; my $provider = $_[0];
my $providerref = $providers{ $provider }; my $providerref = $providers{ $provider };
fatal_error "Unknown provider ($provider)" unless $providerref; unless ( $providerref ) {
fatal_error "Unknown provider ($provider)" unless $provider =~ /^(0x[a-f0-9]+|0[0-7]*|[0-9]*)$/;
my $provider_number = numeric_value $provider;
for ( keys %providers ) {
if ( $providers{$_}{number} == $provider_number ) {
$providerref = $providers{$_};
last;
}
}
fatal_error "Unknown provider ($provider)" unless $providerref;
}
$providerref->{shared} ? $providerref->{number} : 0; $providerref->{shared} ? $providerref->{number} : 0;
} }