diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-09-01 03:11:18 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-09-01 03:11:18 +0000 |
commit | 01c9ed69d5e6c7bfc1ec21b72d071cd57c4a2611 (patch) | |
tree | 2e658dc21b16b7334ce9ce10fd63495dac4f5fe2 /perl-install | |
parent | 44b7362589cdb92d3171a8a1c15bb38623b4f623 (diff) | |
download | drakx-01c9ed69d5e6c7bfc1ec21b72d071cd57c4a2611.tar drakx-01c9ed69d5e6c7bfc1ec21b72d071cd57c4a2611.tar.gz drakx-01c9ed69d5e6c7bfc1ec21b72d071cd57c4a2611.tar.bz2 drakx-01c9ed69d5e6c7bfc1ec21b72d071cd57c4a2611.tar.xz drakx-01c9ed69d5e6c7bfc1ec21b72d071cd57c4a2611.zip |
(get_internet_connection) if no default route exits, take first route in order
to not have strange messages in net_appletb
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/network/tools.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index cfd92734b..6fa8173a2 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -277,7 +277,9 @@ sub get_internet_connection { my ($netc, $intf, $o_gw_intf) = @_; my @routes = `$::prefix/sbin/ip route show`; my ($gw_intf, $is_up, $gw_address); - $gw_intf = $o_gw_intf || get_default_gateway_interface($netc, $intf) or return; + $gw_intf = $o_gw_intf || get_default_gateway_interface($netc, $intf) || + if_(`$::prefix/sbin/ip route show` =~ m!^[0-9a-f./]*\s+dev\s+(\S+)!m, $1) + or return; $is_up = to_bool(grep { /\s+dev\s+$gw_intf(?:\s+|$)/ } @routes); ($gw_address) = join('', @routes) =~ /^default\s+via\s+(\S+).*\s+dev\s+$gw_intf(?:\s+|$)/m; return $gw_intf, $is_up, $gw_address, $netc->{dnsServer}; |