diff options
-rwxr-xr-x | dgd/dgd | 8 | ||||
-rwxr-xr-x | dgd/rc.uplink | 4 |
2 files changed, 5 insertions, 7 deletions
@@ -434,21 +434,23 @@ sub link_is_alive { sub check_links { my $link; foreach $link (@links) { $link->{alive} = 0; } debug(1, "checking links ".($#links+1).", probes $config{core}{probes}"); - my $p = Net::Ping->new("icmp", $config{core}{timeout}); for (my $i = 0; $i < $config{core}{probes}; $i++) { foreach $link (@links) { - debug(3, "ping $link->{name}"); next if link_is_alive($link); + debug(3, "ping $link->{name}"); + my $p = Net::Ping->new("icmp", $config{core}{timeout}, undef, + $link->{if}); ++$link->{alive} if $p->ping($link->{gw}); + $p->close(); + debug(3, "$link->{name} " . ($link->{alive} ? "alive" : "dead")); } } - $p->close(); if (!defined($active_link)) { return 1; } elsif (!link_is_alive($active_link)) { my $name = $links[$active_link]->{name}; error("link $name went down"); updown('down', $name); diff --git a/dgd/rc.uplink b/dgd/rc.uplink index f116293..239d85f 100755 --- a/dgd/rc.uplink +++ b/dgd/rc.uplink @@ -23,16 +23,12 @@ END { } }' $rt_tables) if [ -n "$n" ]; then echo "$n $1" >> $rt_tables fi ip rule add from $3 table $1 - ip rule add from $5 table $1 - if [ -n "$6" ]; then - ip rule add from $6 table $1 - fi ip route add default via $4 table $1 if [ -n "$7" ]; then ip route add $7 dev $2 src $3 table $1 fi test -d $linkdir || mkdir -p $linkdir cat > "$linkdir/$1" <<EOF |