mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-29 17:09:32 +01:00
Merge branch '4.5.5'
Conflicts: Shorewall/Perl/Shorewall/Providers.pm
This commit is contained in:
commit
19cace7e8d
@ -698,13 +698,14 @@ CEOF
|
|||||||
emit '';
|
emit '';
|
||||||
if ( $gateway ) {
|
if ( $gateway ) {
|
||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
emit qq(run_ip route replace $gateway dev $physical table ) . DEFAULT_TABLE;
|
emit qq(run_ip route replace $gateway/32 dev $physical table ) . DEFAULT_TABLE;
|
||||||
emit qq(run_ip route replace default via $gateway src $address dev $physical table ) . DEFAULT_TABLE . qq( metric $number);
|
emit qq(run_ip route replace default via $gateway src $address dev $physical table ) . DEFAULT_TABLE . qq( metric $number);
|
||||||
} else {
|
} else {
|
||||||
emit qq(qt \$IP -6 route del default via $gateway src $address dev $physical table ) . DEFAULT_TABLE . qq( metric $number);
|
emit qq(qt \$IP -6 route del default via $gateway src $address dev $physical table ) . DEFAULT_TABLE . qq( metric $number);
|
||||||
emit qq(run_ip route add default via $gateway src $address dev $physical table ) . DEFAULT_TABLE . qq( metric $number);
|
emit qq(run_ip route add default via $gateway src $address dev $physical table ) . DEFAULT_TABLE . qq( metric $number);
|
||||||
}
|
}
|
||||||
emit qq(echo "qt \$IP -$family route del default via $gateway table ) . DEFAULT_TABLE . qq(" >> \${VARDIR}/undo_${table}_routing);
|
emit qq(echo "qt \$IP -$family route del default via $gateway table ) . DEFAULT_TABLE . qq(" >> \${VARDIR}/undo_${table}_routing);
|
||||||
|
emit qq(echo "qt \$IP -4 route del $gateway/32 dev $physical table ) . DEFAULT_TABLE . qq(" >> \${VARDIR}/undo_${table}_routing) if $family == F_IPV4;
|
||||||
} else {
|
} else {
|
||||||
emit qq(run_ip route add default table ) . DEFAULT_TABLE . qq( dev $physical metric $number);
|
emit qq(run_ip route add default table ) . DEFAULT_TABLE . qq( dev $physical metric $number);
|
||||||
emit qq(echo "qt \$IP -$family route del default dev $physical table ) . DEFAULT_TABLE . qq(" >> \${VARDIR}/undo_${table}_routing);
|
emit qq(echo "qt \$IP -$family route del default dev $physical table ) . DEFAULT_TABLE . qq(" >> \${VARDIR}/undo_${table}_routing);
|
||||||
@ -1156,14 +1157,16 @@ sub finish_providers() {
|
|||||||
|
|
||||||
emit( " progress_message \"Fallback route '\$(echo \$FALLBACK_ROUTE | sed 's/\$\\s*//')' Added\"",
|
emit( " progress_message \"Fallback route '\$(echo \$FALLBACK_ROUTE | sed 's/\$\\s*//')' Added\"",
|
||||||
'else',
|
'else',
|
||||||
'#',
|
' #',
|
||||||
'# We don\'t have any \'fallback\' providers so we delete any default routes in the default table',
|
' # We don\'t have any \'fallback\' providers so we delete any default routes in the default table',
|
||||||
'#',
|
' #',
|
||||||
" while qt \$IP -$family route del default table " . DEFAULT_TABLE . '; do true; done',
|
' delete_default_routes ' . DEFAULT_TABLE,
|
||||||
'fi',
|
'fi',
|
||||||
'' );
|
'' );
|
||||||
} elsif ( $config{USE_DEFAULT_RT} ) {
|
} elsif ( $config{USE_DEFAULT_RT} ) {
|
||||||
emit "while qt \$IP -$family route del default table " . DEFAULT_TABLE . '; do true; done' unless $metrics;
|
emit( 'delete_default_routes ' . DEFAULT_TABLE,
|
||||||
|
''
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
unless ( $config{KEEP_RT_TABLES} ) {
|
unless ( $config{KEEP_RT_TABLES} ) {
|
||||||
|
@ -339,6 +339,16 @@ replace_default_route() # $1 = USE_DEFAULT_RT
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Delete default routes with metric 0 from the passed routing table
|
||||||
|
#
|
||||||
|
delete_default_routes() # $1 = table number
|
||||||
|
{
|
||||||
|
$IP -$g_family route ls table $1 | fgrep default | fgrep -v metric | while read route; do
|
||||||
|
qt $IP -$g_family route del $route
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
restore_default_route() # $1 = USE_DEFAULT_RT
|
restore_default_route() # $1 = USE_DEFAULT_RT
|
||||||
{
|
{
|
||||||
local result
|
local result
|
||||||
|
Loading…
Reference in New Issue
Block a user