From 01c9ed69d5e6c7bfc1ec21b72d071cd57c4a2611 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 1 Sep 2004 03:11:18 +0000 Subject: (get_internet_connection) if no default route exits, take first route in order to not have strange messages in net_appletb --- perl-install/network/tools.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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}; -- cgit v1.2.1