From ae4718fb2fdd63a338d7c6be984fc8002bcd8f2d Mon Sep 17 00:00:00 2001 From: teastep Date: Wed, 21 Mar 2007 17:16:47 +0000 Subject: [PATCH] Reduce the number of exported symbols from the Providers module git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5609 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- New/Shorewall/Providers.pm | 8 ++++---- New/Shorewall/Tc.pm | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/New/Shorewall/Providers.pm b/New/Shorewall/Providers.pm index be6cb7de3..335f2424b 100644 --- a/New/Shorewall/Providers.pm +++ b/New/Shorewall/Providers.pm @@ -31,7 +31,7 @@ use Shorewall::Chains; use strict; our @ISA = qw(Exporter); -our @EXPORT = qw( setup_providers %routemarked_interfaces $routemarked_interfaces); +our @EXPORT = qw( setup_providers @routemarked_interfaces); our @EXPORT_OK = ( ); our @VERSION = 1.00; @@ -42,7 +42,7 @@ use constant { LOCAL_NUMBER => 255, }; our %routemarked_interfaces; -our $routemarked_interfaces = 0; +our @routemarked_interfaces; my $balance = 0; my $first_default_route = 1; @@ -241,7 +241,7 @@ sub setup_providers() { fatal_error "Interface $interface is tracked through an earlier provider" if $routemarked_interfaces{$interface}; fatal_error "The 'track' option requires a numeric value in the MARK column - Provider \"$line\"" if $mark eq '-'; $routemarked_interfaces{$interface} = $mark; - $routemarked_interfaces++; + push @routemarked_interfaces, $interface; } elsif ( $option =~ /^balance=(\d+)/ ) { balance_default_route $1 , $gateway, $interface; } elsif ( $option eq 'balance' ) { @@ -437,7 +437,7 @@ sub setup_providers() { pop_indent; emit "fi\n"; - setup_route_marking if $routemarked_interfaces; + setup_route_marking if @routemarked_interfaces; } diff --git a/New/Shorewall/Tc.pm b/New/Shorewall/Tc.pm index f5bad8177..259d307bf 100644 --- a/New/Shorewall/Tc.pm +++ b/New/Shorewall/Tc.pm @@ -530,10 +530,10 @@ sub setup_tc() { my $mark_part = ''; - if ( $routemarked_interfaces && ! $config{TC_EXPERT} ) { + if ( @routemarked_interfaces && ! $config{TC_EXPERT} ) { $mark_part = '-m mark --mark 0/0xFF00'; - for my $interface ( keys %routemarked_interfaces ) { + for my $interface ( @routemarked_interfaces ) { add_rule $mangle_table->{PREROUTING} , "-i $interface -j tcpre"; } }