Initialize the 'id' member of reserved tables after .conf has been read.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-03-26 07:36:57 -07:00
parent 61e21de41b
commit 792a19bf4b

View File

@ -104,7 +104,9 @@ sub initialize( $ ) {
$first_fallback_route = 1; $first_fallback_route = 1;
$maxload = 0; $maxload = 0;
$tproxies = 0; $tproxies = 0;
#
# The 'id' member is initialized in process_providers(), after the .conf file has been processed
#
%providers = ( local => { provider => 'local', number => LOCAL_TABLE , mark => 0 , optional => 0 ,routes => [], rules => [] , routedests => {} } , %providers = ( local => { provider => 'local', number => LOCAL_TABLE , mark => 0 , optional => 0 ,routes => [], rules => [] , routedests => {} } ,
main => { provider => 'main', number => MAIN_TABLE , mark => 0 , optional => 0 ,routes => [], rules => [] , routedests => {} } , main => { provider => 'main', number => MAIN_TABLE , mark => 0 , optional => 0 ,routes => [], rules => [] , routedests => {} } ,
default => { provider => 'default', number => DEFAULT_TABLE , mark => 0 , optional => 0 ,routes => [], rules => [] , routedests => {} } , default => { provider => 'default', number => DEFAULT_TABLE , mark => 0 , optional => 0 ,routes => [], rules => [] , routedests => {} } ,
@ -112,15 +114,6 @@ sub initialize( $ ) {
unspec => { provider => 'unspec', number => UNSPEC_TABLE , mark => 0 , optional => 0 ,routes => [], rules => [] , routedests => {} } ); unspec => { provider => 'unspec', number => UNSPEC_TABLE , mark => 0 , optional => 0 ,routes => [], rules => [] , routedests => {} } );
@providers = (); @providers = ();
unless ( $config{USE_RT_NAMES} ) {
for ( values %providers ) {
$_->{id} = $_->{number};
}
} else {
for ( values %providers ) {
$_->{id} = $_->{provider};
}
}
} }
# #
@ -1347,6 +1340,16 @@ sub process_providers( $ ) {
our $providers = 0; our $providers = 0;
our $pseudoproviders = 0; our $pseudoproviders = 0;
unless ( $config{USE_RT_NAMES} ) {
for ( values %providers ) {
$_->{id} = $_->{number};
}
} else {
for ( values %providers ) {
$_->{id} = $_->{provider};
}
}
$lastmark = 0; $lastmark = 0;
if ( my $fn = open_file 'providers' ) { if ( my $fn = open_file 'providers' ) {