diff options
author | Olivier Blin <blino@mageia.org> | 2012-05-10 20:06:37 +0000 |
---|---|---|
committer | Olivier Blin <blino@mageia.org> | 2012-05-10 20:06:37 +0000 |
commit | 6e5569712fe28ceaa166a8d28928850f89ace12d (patch) | |
tree | d9bea2bc285b271a839cd1133a424dd36eb0d1e7 | |
parent | f3c8993dbc4b1330a09f6137b0e206c7de9b85e9 (diff) | |
download | drakx-net-6e5569712fe28ceaa166a8d28928850f89ace12d.tar drakx-net-6e5569712fe28ceaa166a8d28928850f89ace12d.tar.gz drakx-net-6e5569712fe28ceaa166a8d28928850f89ace12d.tar.bz2 drakx-net-6e5569712fe28ceaa166a8d28928850f89ace12d.tar.xz drakx-net-6e5569712fe28ceaa166a8d28928850f89ace12d.zip |
fix connectivity test during install (and possibly standalone) by
calling res_init before hostname resolution (#5772)
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | lib/network/network.pm | 3 | ||||
-rw-r--r-- | lib/network/tools.pm | 7 |
3 files changed, 6 insertions, 7 deletions
@@ -1,3 +1,6 @@ +- fix connectivity test during install (and possibly standalone) by + calling res_init before hostname resolution (#5772) + 1.11 - fix testing network connectivy test after resolv.conf changes (Derek Jennings, mga#5772) diff --git a/lib/network/network.pm b/lib/network/network.pm index 0c46bc0..ccc3ec9 100644 --- a/lib/network/network.pm +++ b/lib/network/network.pm @@ -6,6 +6,7 @@ package network::network; # $Id: network.pm 268044 2010-04-30 13:31:34Z blino $w use strict; +use c; use lang; use Socket; use common; @@ -167,7 +168,7 @@ sub write_resolv_conf { }; output_with_perm($file, 0644, @search, @nameserver, (map { "# $_\n" } @unknown), "\n# ppp temp entry\n"); - #-res_init(); # reinit the resolver so DNS changes take affect + c::res_init(); # reinit the resolver so DNS changes take affect 1; } else { log::explanations("neither domain name nor dns server are configured"); 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; } |