mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-25 17:13:11 +01:00
Back out silly 2000::/3 change
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9107 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
828796a678
commit
65b1494257
@ -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)"',
|
||||
|
@ -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?
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user