summaryrefslogtreecommitdiffstats
path: root/lib/network/tools.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2011-07-27 10:30:56 +0000
committerThierry Vignaud <tv@mageia.org>2011-07-27 10:30:56 +0000
commit62458281208a3424e1ebf34d58b102fb4adb12d6 (patch)
tree95c0af380658b238930dca0bed26e17f8c1507d0 /lib/network/tools.pm
parent1866da463fcdd1e89f38b153b220540c1937305c (diff)
downloaddrakx-net-62458281208a3424e1ebf34d58b102fb4adb12d6.tar
drakx-net-62458281208a3424e1ebf34d58b102fb4adb12d6.tar.gz
drakx-net-62458281208a3424e1ebf34d58b102fb4adb12d6.tar.bz2
drakx-net-62458281208a3424e1ebf34d58b102fb4adb12d6.tar.xz
drakx-net-62458281208a3424e1ebf34d58b102fb4adb12d6.zip
(get_routes) make network connectivity check work with kernel-2.6.39+ (#1266)
Diffstat (limited to 'lib/network/tools.pm')
-rw-r--r--lib/network/tools.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/network/tools.pm b/lib/network/tools.pm
index 60eeb8b..ed6ec39 100644
--- a/lib/network/tools.pm
+++ b/lib/network/tools.pm
@@ -263,7 +263,10 @@ sub host_hex_to_dotted {
sub get_routes() {
my %routes;
- foreach (cat_("/proc/net/route")) {
+ my @routes = cat_("/proc/net/route");
+ require bootloader;
+ @routes = reverse(@routes) if bootloader::cmp_kernel_versions(c::kernel_version(), "2.6.39") >= 0;
+ foreach (@routes) {
if (/^(\S+)\s+([0-9A-F]+)\s+([0-9A-F]+)\s+[0-9A-F]+\s+\d+\s+\d+\s+(\d+)\s+([0-9A-F]+)/) {
if (defined $3) { $routes{$1}{gateway} = hex($3) ? host_hex_to_dotted($3) : $routes{$1}{network} }
if (defined $2) { $routes{$1}{network} = host_hex_to_dotted($2) }