mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-16 03:10:39 +01:00
Implement a better solution to down shared gateways
This commit is contained in:
parent
9a78a0242f
commit
7989f5094e
@ -121,7 +121,9 @@ sub setup_route_marking() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $providerref->{shared} ) {
|
if ( $providerref->{shared} ) {
|
||||||
|
add_commands( $chainref, qq(if [ -n "$providerref->{mac}" ]; then) ), incr_cmd_level( $chainref ) if $providerref->{optional};
|
||||||
add_rule $chainref, match_source_dev( $interface ) . "-m mac --mac-source $providerref->{mac} -j MARK --set-mark $providerref->{mark}";
|
add_rule $chainref, match_source_dev( $interface ) . "-m mac --mac-source $providerref->{mac} -j MARK --set-mark $providerref->{mark}";
|
||||||
|
decr_cmd_level( $chainref ), add_commands( $chainref, "fi\n" ) if $providerref->{optional};
|
||||||
} else {
|
} else {
|
||||||
add_rule $chainref, match_source_dev( $interface ) . "-j MARK --set-mark $providerref->{mark}";
|
add_rule $chainref, match_source_dev( $interface ) . "-j MARK --set-mark $providerref->{mark}";
|
||||||
}
|
}
|
||||||
@ -520,13 +522,7 @@ sub add_a_provider( ) {
|
|||||||
|
|
||||||
if ( $optional ) {
|
if ( $optional ) {
|
||||||
if ( $shared ) {
|
if ( $shared ) {
|
||||||
my $var = $providers{$table}{mac};
|
emit ( " error_message \"WARNING: Gateway $gateway is not reachable -- Provider $table ($number) not Added\"" );
|
||||||
|
|
||||||
$var =~ s/^\$//;
|
|
||||||
|
|
||||||
emit ( " error_message \"WARNING: Gateway $gateway is not reachable -- Provider $table ($number) not Added\"" ,
|
|
||||||
" $var=02:00:00:00:00:00" );
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
emit ( " error_message \"WARNING: Interface $physical is not usable -- Provider $table ($number) not Added\"" );
|
emit ( " error_message \"WARNING: Interface $physical is not usable -- Provider $table ($number) not Added\"" );
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ our @EXPORT = qw( NOTHING
|
|||||||
);
|
);
|
||||||
|
|
||||||
our @EXPORT_OK = qw( initialize );
|
our @EXPORT_OK = qw( initialize );
|
||||||
our $VERSION = '4.4_16';
|
our $VERSION = '4.4_15';
|
||||||
|
|
||||||
#
|
#
|
||||||
# IPSEC Option types
|
# IPSEC Option types
|
||||||
@ -913,7 +913,7 @@ sub process_interface( $$ ) {
|
|||||||
$root = substr( $interface, 0, -1 );
|
$root = substr( $interface, 0, -1 );
|
||||||
$roots{$root} = $interface;
|
$roots{$root} = $interface;
|
||||||
my $len = length $root;
|
my $len = length $root;
|
||||||
|
|
||||||
if ( $minroot ) {
|
if ( $minroot ) {
|
||||||
$minroot = $len if $minroot > $len;
|
$minroot = $len if $minroot > $len;
|
||||||
} else {
|
} else {
|
||||||
@ -1209,23 +1209,23 @@ sub known_interface($)
|
|||||||
|
|
||||||
my $iface = $interface;
|
my $iface = $interface;
|
||||||
|
|
||||||
while ( 1 ) {
|
if ( $minroot ) {
|
||||||
chop $iface;
|
while ( length $iface > $minroot ) {
|
||||||
|
chop $iface;
|
||||||
|
|
||||||
return 0 if $iface eq '';
|
if ( my $i = $roots{$iface} ) {
|
||||||
|
$interfaceref = $interfaces{$i};
|
||||||
if ( my $i = $roots{$iface} ) {
|
|
||||||
$interfaceref = $interfaces{$i};
|
|
||||||
|
|
||||||
my $physical = map_physical( $interface, $interfaceref );
|
my $physical = map_physical( $interface, $interfaceref );
|
||||||
|
|
||||||
return $interfaces{$interface} = { options => $interfaceref->{options} ,
|
return $interfaces{$interface} = { options => $interfaceref->{options} ,
|
||||||
bridge => $interfaceref->{bridge} ,
|
bridge => $interfaceref->{bridge} ,
|
||||||
name => $i ,
|
name => $i ,
|
||||||
number => $interfaceref->{number} ,
|
number => $interfaceref->{number} ,
|
||||||
physical => $physical ,
|
physical => $physical ,
|
||||||
base => chain_base( $physical ) ,
|
base => chain_base( $physical ) ,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,11 @@ Beta 6
|
|||||||
|
|
||||||
- Failure to treat the interface as optional or required.
|
- Failure to treat the interface as optional or required.
|
||||||
|
|
||||||
|
4) Where two ISPs share the same interface, if one of the ISPs was not
|
||||||
|
reachable, an iptables-restore error such as this occurred:
|
||||||
|
|
||||||
|
iptables-restore v1.4.10: Bad mac address "-j"
|
||||||
|
|
||||||
Beta 5
|
Beta 5
|
||||||
|
|
||||||
1) Previously, proxy ARP with logical interface names did not
|
1) Previously, proxy ARP with logical interface names did not
|
||||||
|
Loading…
Reference in New Issue
Block a user