From 833676ec48c765f448c9d93eb2b69e93b104f1a3 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 7 Apr 2005 10:51:24 +0000 Subject: don't truncate default gateway (#15247) --- perl-install/standalone/drakroam | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'perl-install/standalone/drakroam') 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)); -- cgit v1.2.1