summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-05-29 14:10:28 +0000
committerOlivier Blin <oblin@mandriva.com>2008-05-29 14:10:28 +0000
commitfeb69a79f799a757f8506e6e0e12be1d6d031c14 (patch)
tree182a5fb44f43b4cf62318fbfa3591b773a749e1d /lib
parent46ec0e3237b13c3a00bd847551d1b921c0e30135 (diff)
downloaddrakx-net-feb69a79f799a757f8506e6e0e12be1d6d031c14.tar
drakx-net-feb69a79f799a757f8506e6e0e12be1d6d031c14.tar.gz
drakx-net-feb69a79f799a757f8506e6e0e12be1d6d031c14.tar.bz2
drakx-net-feb69a79f799a757f8506e6e0e12be1d6d031c14.tar.xz
drakx-net-feb69a79f799a757f8506e6e0e12be1d6d031c14.zip
find ptp gateway earlier
Diffstat (limited to 'lib')
-rw-r--r--lib/network/tools.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/network/tools.pm b/lib/network/tools.pm
index 1b49572..adddf0e 100644
--- a/lib/network/tools.pm
+++ b/lib/network/tools.pm
@@ -189,8 +189,7 @@ sub get_interface_status {
my ($intf) = @_;
$intf = get_real_interface($intf);
my $routes = get_routes();
- return $routes->{$intf}{network},
- $routes->{$intf}{network} eq '0.0.0.0' && ($routes->{$intf}{gateway} || get_interface_ptp_address($intf));
+ return $routes->{$intf}{network}, $routes->{$intf}{network} eq '0.0.0.0' && $routes->{$intf}{gateway};
}
#- returns (gateway_interface, interface is up, gateway address, dns server address)
@@ -268,6 +267,7 @@ sub get_routes() {
if (defined $4) { $routes{$1}{metric} = $4 }
}
}
+ $routes{$_}{gateway} ||= get_interface_ptp_address($_) foreach keys %routes;
#- TODO: handle IPv6 with /proc/net/ipv6_route
\%routes;
}