mirror of
https://gitlab.com/shorewall/code.git
synced 2025-02-02 02:49:54 +01:00
Merge branch '5.0.12'
Conflicts: Shorewall/Perl/lib.runtime Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
commit
641a7146ca
@ -830,14 +830,19 @@ sub add_a_provider( $$ ) {
|
|||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
emit qq(run_ip route replace $gateway src $address dev $physical ${mtu});
|
emit qq(run_ip route replace $gateway src $address dev $physical ${mtu});
|
||||||
emit qq(run_ip route replace $gateway src $address dev $physical ${mtu}table $id $realm);
|
emit qq(run_ip route replace $gateway src $address dev $physical ${mtu}table $id $realm);
|
||||||
|
emit qq(echo "\$IP route del $gateway src $address dev $physical ${mtu} > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing);
|
||||||
|
emit qq(echo "\$IP route del $gateway src $address dev $physical ${mtu}table $id $realm > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing);
|
||||||
} else {
|
} else {
|
||||||
emit qq(qt \$IP -6 route add $gateway src $address dev $physical ${mtu});
|
emit qq(qt \$IP -6 route add $gateway src $address dev $physical ${mtu});
|
||||||
emit qq(qt \$IP -6 route del $gateway src $address dev $physical ${mtu}table $id $realm);
|
emit qq(qt \$IP -6 route del $gateway src $address dev $physical ${mtu}table $id $realm);
|
||||||
emit qq(run_ip route add $gateway src $address dev $physical ${mtu}table $id $realm);
|
emit qq(run_ip route add $gateway src $address dev $physical ${mtu}table $id $realm);
|
||||||
|
emit qq(echo "\$IP -6 route del $gateway src $address dev $physical ${mtu} > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing );
|
||||||
|
emit qq(echo "\$IP -6 route del $gateway src $address dev $physical ${mtu}table $id $realm > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit "run_ip route add default via $gateway src $address dev $physical ${mtu}table $id $realm";
|
emit( "run_ip route add default via $gateway src $address dev $physical ${mtu}table $id $realm" );
|
||||||
|
emit( qq( echo "\$IP route del default via $gateway src $address dev $physical ${mtu}table $id $realm > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $noautosrc ) {
|
if ( ! $noautosrc ) {
|
||||||
@ -869,7 +874,7 @@ sub add_a_provider( $$ ) {
|
|||||||
pop_indent;
|
pop_indent;
|
||||||
|
|
||||||
emit( qq(fi\n),
|
emit( qq(fi\n),
|
||||||
qq(rm -f \${VARDIR}/${physical}_enabled) );
|
qq(echo 1 > \${VARDIR}/${physical}_disabled) );
|
||||||
|
|
||||||
|
|
||||||
pop_indent;
|
pop_indent;
|
||||||
@ -1083,7 +1088,7 @@ CEOF
|
|||||||
emit( "setup_${dev}_tc" ) if $tcdevices->{$interface};
|
emit( "setup_${dev}_tc" ) if $tcdevices->{$interface};
|
||||||
}
|
}
|
||||||
|
|
||||||
emit( qq( echo 1 > \${VARDIR}/${physical}_enabled) ) if $persistent;
|
emit( qq( rm -f \${VARDIR}/${physical}_disabled) );
|
||||||
emit_started_message( '', 2, $pseudo, $table, $number );
|
emit_started_message( '', 2, $pseudo, $table, $number );
|
||||||
|
|
||||||
pop_indent;
|
pop_indent;
|
||||||
@ -1091,7 +1096,7 @@ CEOF
|
|||||||
unless ( $pseudo ) {
|
unless ( $pseudo ) {
|
||||||
emit( 'else' );
|
emit( 'else' );
|
||||||
emit( qq( echo $weight > \${VARDIR}/${physical}_weight) );
|
emit( qq( echo $weight > \${VARDIR}/${physical}_weight) );
|
||||||
emit( qq( echo 1 > \${VARDIR}/${physical}_enabled) ) if $persistent;
|
emit( qq( rm -f \${VARDIR}/${physical}_disabled) ) if $persistent;
|
||||||
emit_started_message( ' ', '', $pseudo, $table, $number );
|
emit_started_message( ' ', '', $pseudo, $table, $number );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1185,7 +1190,7 @@ CEOF
|
|||||||
'if [ $COMMAND = disable ]; then',
|
'if [ $COMMAND = disable ]; then',
|
||||||
" do_persistent_${what}_${table}",
|
" do_persistent_${what}_${table}",
|
||||||
"else",
|
"else",
|
||||||
" rm -f \${VARDIR}/${physical}_enabled\n",
|
" echo 1 > \${VARDIR}/${physical}_disabled\n",
|
||||||
"fi\n",
|
"fi\n",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1690,7 +1695,7 @@ EOF
|
|||||||
emit ( " if [ ! -f \${VARDIR}/undo_${provider}_routing ]; then",
|
emit ( " if [ ! -f \${VARDIR}/undo_${provider}_routing ]; then",
|
||||||
" start_interface_$provider" );
|
" start_interface_$provider" );
|
||||||
} elsif ( $providerref->{persistent} ) {
|
} elsif ( $providerref->{persistent} ) {
|
||||||
emit ( " if [ ! -f \${VARDIR}/$providerref->{physical}_enabled ]; then",
|
emit ( " if [ -f \${VARDIR}/$providerref->{physical}_disabled ]; then",
|
||||||
" start_provider_$provider" );
|
" start_provider_$provider" );
|
||||||
} else {
|
} else {
|
||||||
emit ( " if [ -z \"`\$IP -$family route ls table $providerref->{number}`\" ]; then",
|
emit ( " if [ -z \"`\$IP -$family route ls table $providerref->{number}`\" ]; then",
|
||||||
@ -1741,7 +1746,7 @@ EOF
|
|||||||
if ( $providerref->{pseudo} ) {
|
if ( $providerref->{pseudo} ) {
|
||||||
emit( " if [ -f \${VARDIR}/undo_${provider}_routing ]; then" );
|
emit( " if [ -f \${VARDIR}/undo_${provider}_routing ]; then" );
|
||||||
} elsif ( $providerref->{persistent} ) {
|
} elsif ( $providerref->{persistent} ) {
|
||||||
emit( " if [ -f \${VARDIR}/$providerref->{physical}_enabled ]; then" );
|
emit( " if [ ! -f \${VARDIR}/$providerref->{physical}_disabled ]; then" );
|
||||||
} else {
|
} else {
|
||||||
emit( " if [ -n \"`\$IP -$family route ls table $providerref->{number}`\" ]; then" );
|
emit( " if [ -n \"`\$IP -$family route ls table $providerref->{number}`\" ]; then" );
|
||||||
}
|
}
|
||||||
|
@ -601,7 +601,11 @@ debug_restore_input() {
|
|||||||
interface_enabled() {
|
interface_enabled() {
|
||||||
status=0
|
status=0
|
||||||
|
|
||||||
[ -f ${VARDIR}/${1}.status ] && status=$(cat ${VARDIR}/${1}.status)
|
if [ -f ${VARDIR}/${1}_disabled ]; then
|
||||||
|
status=1
|
||||||
|
elif [ -f ${VARDIR}/${1}.status ]; then
|
||||||
|
status=$(cat ${VARDIR}/${1}.status)
|
||||||
|
fi
|
||||||
|
|
||||||
return status
|
return status
|
||||||
}
|
}
|
||||||
@ -682,8 +686,10 @@ interface_is_usable() # $1 = interface
|
|||||||
|
|
||||||
if ! loopback_interface $1; then
|
if ! loopback_interface $1; then
|
||||||
if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != 0.0.0.0 ]; then
|
if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != 0.0.0.0 ]; then
|
||||||
[ "$COMMAND" = enable ] || run_isusable_exit $1
|
if [ "$COMMAND" != enable ]; then
|
||||||
status=$?
|
[ ! -f ${VARDIR}/${1}_disabled ] && run_isusable_exit $1
|
||||||
|
status=$?
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
status=1
|
status=1
|
||||||
fi
|
fi
|
||||||
@ -1106,8 +1112,10 @@ interface_is_usable() # $1 = interface
|
|||||||
|
|
||||||
if [ "$1" != lo ]; then
|
if [ "$1" != lo ]; then
|
||||||
if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != :: ]; then
|
if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != :: ]; then
|
||||||
[ "$COMMAND" = enable ] || run_isusable_exit $1
|
if [ "$COMMAND" != enable ]; then
|
||||||
status=$?
|
[ ! -f ${VARDIR}/${1}_disabled ] && run_isusable_exit $1
|
||||||
|
status=$?
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
status=1
|
status=1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user