From 6e5569712fe28ceaa166a8d28928850f89ace12d Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 10 May 2012 20:06:37 +0000 Subject: fix connectivity test during install (and possibly standalone) by calling res_init before hostname resolution (#5772) --- lib/network/tools.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/network/tools.pm') diff --git a/lib/network/tools.pm b/lib/network/tools.pm index 8628bc2..7a94d84 100644 --- a/lib/network/tools.pm +++ b/lib/network/tools.pm @@ -48,12 +48,7 @@ sub stop_net_interface { } sub connected() { - if ($::isInstall) { - # gethostbyname() only reads /etc/resolv.conf once so if resolv.conf is - # not present when the test begins, writing it later is not going to help: - symlink "$::prefix/etc/resolv.conf", "/etc/resolv.conf" if ! -e "/etc/resolv.conf"; - return scalar grep { /1 received/ } `$::prefix/bin/ping -qc1 www.mageia.org`; - } + c::res_init(); # reinit the resolver so DNS changes take affect gethostbyname("www.mageia.org") ? 1 : 0; } -- cgit v1.2.1