mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-11 16:18:13 +01:00
Don't configure persistence if the interface has no address
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
69dd7ce0b9
commit
56bf8b1572
@ -794,6 +794,8 @@ sub add_a_provider( $$ ) {
|
|||||||
if ( $gateway ) {
|
if ( $gateway ) {
|
||||||
$address = get_interface_address $interface unless $address;
|
$address = get_interface_address $interface unless $address;
|
||||||
|
|
||||||
|
emit( qq([ -z "$address" ] && return\n) );
|
||||||
|
|
||||||
if ( $hostroute ) {
|
if ( $hostroute ) {
|
||||||
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});
|
||||||
@ -1068,7 +1070,9 @@ CEOF
|
|||||||
emit( qq(echo 1 > \${VARDIR}/${physical}.status) );
|
emit( qq(echo 1 > \${VARDIR}/${physical}.status) );
|
||||||
|
|
||||||
if ( $optional ) {
|
if ( $optional ) {
|
||||||
emit( "persistent_${what}_${table}\n" ) if $persistent;
|
if ( $persistent ) {
|
||||||
|
emit( "persistent_${what}_${table}\n" );
|
||||||
|
}
|
||||||
|
|
||||||
if ( $shared ) {
|
if ( $shared ) {
|
||||||
emit ( "error_message \"WARNING: Gateway $gateway is not reachable -- Provider $table ($number) not Started\"" );
|
emit ( "error_message \"WARNING: Gateway $gateway is not reachable -- Provider $table ($number) not Started\"" );
|
||||||
@ -1142,7 +1146,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"
|
" rm -f \${VARDIR}/${physical}_enabled\n",
|
||||||
"fi\n",
|
"fi\n",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user