From 7067a3d53d52cda72024209e93b2c04518bd89eb Mon Sep 17 00:00:00 2001 From: teastep Date: Mon, 11 Feb 2008 18:52:49 +0000 Subject: [PATCH] Improve check for shared-interface provider git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8183 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Providers.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Shorewall-perl/Shorewall/Providers.pm b/Shorewall-perl/Shorewall/Providers.pm index c74a6c20f..2d6c100a2 100644 --- a/Shorewall-perl/Shorewall/Providers.pm +++ b/Shorewall-perl/Shorewall/Providers.pm @@ -585,7 +585,21 @@ sub lookup_provider( $ ) { my $provider = $_[0]; 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; }