From 65b149425717d452ce8f10507887b1fbf31b959d Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 18 Dec 2008 00:32:20 +0000 Subject: [PATCH] Back out silly 2000::/3 change git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9107 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Providers.pm | 12 ++++-------- Shorewall-perl/prog.header | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Shorewall-perl/Shorewall/Providers.pm b/Shorewall-perl/Shorewall/Providers.pm index 8d0a54e9e..7ecc2cf5a 100644 --- a/Shorewall-perl/Shorewall/Providers.pm +++ b/Shorewall-perl/Shorewall/Providers.pm @@ -56,9 +56,6 @@ our @providers; our $family; -our $default; - - # # Initialize globals -- we take this novel approach to globals initialization to allow # the compiler to run multiple times in the same process. The @@ -76,7 +73,6 @@ sub initialize( $ ) { @routemarked_interfaces = (); $balance = 0; $first_default_route = 1; - $default = $family == F_IPV4 ? 'default' : '2000::/3'; %providers = ( local => { number => LOCAL_TABLE , mark => 0 , optional => 0 } , main => { number => MAIN_TABLE , mark => 0 , optional => 0 } , @@ -243,7 +239,7 @@ sub add_a_provider( $$$$$$$$ ) { } else { fatal_error "Configuring multiple providers through one interface requires a gateway" if $shared; $gateway = ''; - emit "run_ip route add $default dev $interface table $number"; + emit "run_ip route add default dev $interface table $number"; } my $val = 0; @@ -356,7 +352,7 @@ sub add_a_provider( $$$$$$$$ ) { if ( $gateway ) { $address = get_interface_address $interface unless $address; emit "run_ip route replace $gateway src $address dev $interface ${mtu}table $number $realm"; - emit "run_ip route add $default via $gateway src $address dev $interface ${mtu}table $number $realm"; + emit "run_ip route add default via $gateway src $address dev $interface ${mtu}table $number $realm"; } balance_default_route $balance , $gateway, $interface, $realm if $balance; @@ -552,8 +548,8 @@ sub setup_providers() { } emit ( 'if [ -n "$DEFAULT_ROUTE" ]; then' ); - emit ( " run_ip route replace $default scope global table $table \$DEFAULT_ROUTE" ); - emit ( " qt ip -$family route del $default table " . MAIN_TABLE ) if $config{USE_DEFAULT_RT}; + emit ( " run_ip route replace default scope global table $table \$DEFAULT_ROUTE" ); + emit ( " qt ip -$family route del default table " . MAIN_TABLE ) if $config{USE_DEFAULT_RT}; emit ( " progress_message \"Default route '\$(echo \$DEFAULT_ROUTE | sed 's/\$\\s*//')' Added\"", 'else', ' error_message "WARNING: No Default route added (all \'balance\' providers are down)"', diff --git a/Shorewall-perl/prog.header b/Shorewall-perl/prog.header index 56297006e..a029ab677 100644 --- a/Shorewall-perl/prog.header +++ b/Shorewall-perl/prog.header @@ -801,7 +801,7 @@ detect_gateway() # $1 = interface # # Maybe there's a default route through this gateway already # - [ -n "$gateway" ] || gateway=$(find_gateway $(ip -4 route list dev $interface)) + [ -n "$gateway" ] || gateway=$(find_gateway $(ip -4 route list dev $interface | grep ^default)) # # Last hope -- is there a load-balancing route through the interface? #