From 20ab9d7cfa09a21f75591de7a5015fa3aa284aa5 Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 14 Jun 2007 14:58:48 +0000 Subject: [PATCH] Call the Proxyarp initializer in an INIT block; add other missing initializer calls git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6540 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Compiler.pm | 17 +++++++++++------ Shorewall-perl/Shorewall/Macros.pm | 2 +- Shorewall-perl/Shorewall/Proxyarp.pm | 6 +++++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Shorewall-perl/Shorewall/Compiler.pm b/Shorewall-perl/Shorewall/Compiler.pm index 4c40e78b3..8099ed9af 100644 --- a/Shorewall-perl/Shorewall/Compiler.pm +++ b/Shorewall-perl/Shorewall/Compiler.pm @@ -54,18 +54,23 @@ our $reused = 0; use constant { EXPORT => 0x01 , TIMESTAMP => 0x02 }; -sub initialize() { +# +# Reinitilize the package-globals in the other modules +# +sub reinitialize() { Shorewall::Common::initialize; Shorewall::Config::initialize; Shorewall::Chains::initialize; + Shorewall::Zones::initialize; Shorewall::Interfaces::initialize; - Shorewall::Accounting::initialize; - Shorewall::Actions::initialize; Shorewall::Nat::initialize; Shorewall::Providers::initialize; - Shorewall::Rules::initialize; Shorewall::Tc::initialize; - Shorewall::Zones::initialize; + Shorewall::Macros::initialize; + Shorewall::Actions::initialize; + Shorewall::Accounting::initialize; + Shorewall::Rules::initialize; + Shorewall::Proxyarp::initialize; } # @@ -675,7 +680,7 @@ sub compiler( $$$$ ) { $export = 0; - initialize if $reused++; + reinitialize if $reused++; if ( $directory ne '' ) { fatal_error "$directory is not an existing directory" unless -d $directory; diff --git a/Shorewall-perl/Shorewall/Macros.pm b/Shorewall-perl/Shorewall/Macros.pm index 646dd1fdb..233c1803d 100644 --- a/Shorewall-perl/Shorewall/Macros.pm +++ b/Shorewall-perl/Shorewall/Macros.pm @@ -39,7 +39,7 @@ our @EXPORT = qw( find_macro merge_macro_column %macros ); -our @EXPORT_OK = qw( ); +our @EXPORT_OK = qw( initialize ); our @VERSION = 1.00; diff --git a/Shorewall-perl/Shorewall/Proxyarp.pm b/Shorewall-perl/Shorewall/Proxyarp.pm index d4c95ec63..0b26eb6b6 100644 --- a/Shorewall-perl/Shorewall/Proxyarp.pm +++ b/Shorewall-perl/Shorewall/Proxyarp.pm @@ -35,7 +35,7 @@ our @EXPORT = qw( dump_proxy_arp ); -our @EXPORT_OK = qw( ); +our @EXPORT_OK = qw( initialize ); our @VERSION = 1.00; our @proxyarp; @@ -44,6 +44,10 @@ sub initialize() { @proxyarp = (); } +INIT { + initialize; +} + sub setup_one_proxy_arp( $$$$$ ) { my ( $address, $interface, $external, $haveroute, $persistent) = @_;