aboutsummaryrefslogtreecommitdiff
path: root/dgd/dgd
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2015-07-10 15:29:23 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2015-07-10 15:29:23 +0300
commite3ea08d43ccf0a117b10e9d52c91612281a4193f (patch)
tree89434b6bd5e4a8edca22ae3f1903d80bb0ce0948 /dgd/dgd
parent5bbf06a701121f6c66f569e6ef99fddf017e95cd (diff)
downloaddnstools-e3ea08d43ccf0a117b10e9d52c91612281a4193f.tar.gz
dnstools-e3ea08d43ccf0a117b10e9d52c91612281a4193f.tar.bz2
dgd: ensure gateways are probed from the corresponding interfaces
* dgd/dgd (check_links): Bind to the corresponding interface before piniging. * dgd/rc.uplink (linksetup): Remove useless rules
Diffstat (limited to 'dgd/dgd')
-rwxr-xr-xdgd/dgd8
1 files changed, 5 insertions, 3 deletions
diff --git a/dgd/dgd b/dgd/dgd
index 5b467e4..f809cc8 100755
--- a/dgd/dgd
+++ b/dgd/dgd
@@ -437,15 +437,17 @@ sub check_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)) {

Return to:

Send suggestions and report system problems to the System administrator.