summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-04-07 10:51:24 +0000
committerOlivier Blin <oblin@mandriva.org>2005-04-07 10:51:24 +0000
commit833676ec48c765f448c9d93eb2b69e93b104f1a3 (patch)
tree2f1d9bc0f4d3690c108dfcc7634cdb1831b62352
parent59f9a21b8acc9cf7f58504c6c6402e77c49d78fd (diff)
downloaddrakx-833676ec48c765f448c9d93eb2b69e93b104f1a3.tar
drakx-833676ec48c765f448c9d93eb2b69e93b104f1a3.tar.gz
drakx-833676ec48c765f448c9d93eb2b69e93b104f1a3.tar.bz2
drakx-833676ec48c765f448c9d93eb2b69e93b104f1a3.tar.xz
drakx-833676ec48c765f448c9d93eb2b69e93b104f1a3.zip
don't truncate default gateway (#15247)
-rwxr-xr-xperl-install/standalone/drakroam5
1 files changed, 3 insertions, 2 deletions
diff --git a/perl-install/standalone/drakroam b/perl-install/standalone/drakroam
index 930bca1fc..acd6e9448 100755
--- a/perl-install/standalone/drakroam
+++ b/perl-install/standalone/drakroam
@@ -33,11 +33,12 @@ use run_program;
use Glib qw(TRUE FALSE);
use ugtk2 qw(:create :helpers :wrappers);
use Gtk2::SimpleList;
+use Socket;
require_root_capability();
# global settings
-my $route = '/sbin/route';
+my $route = '/sbin/route -n';
my $IWList = '/sbin/iwlist';
my $IWConfig = '/sbin/iwconfig';
my $IFConfig = '/sbin/ifconfig';
@@ -266,7 +267,7 @@ sub UpdateStatus() {
if (/inet addr:(\S*)\s/) { $CurrentIP = $1 }
}
foreach (run_program::get_stdout($route)) {
- if (/default\s*(\S*)\s/) { $CurrentGW = $1 }
+ if (/^0.0.0.0\s*(\S*)\s/) { $CurrentGW = gethostbyaddr(inet_aton($1), AF_INET) }
else { $CurrentGW = "---.---.---.---" }
}
$NetLabel->set_text(N("Network: %s", $CurrentNet));