On Fri, 2014-05-09 at 05:44 +0200, poma wrote:
> Signed-off-by: poma <[email protected]>
Though this really is a Fedora specific patch since it references things
that only the ifcfg-rh plugin does. So I'm not sure it's really
suitable for upstream.
Dan
> ---
> src/dns-manager/nm-dns-manager.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/src/dns-manager/nm-dns-manager.c
> b/src/dns-manager/nm-dns-manager.c
> index fe8cf6c..d0268e2 100644
> --- a/src/dns-manager/nm-dns-manager.c
> +++ b/src/dns-manager/nm-dns-manager.c
> @@ -375,7 +375,7 @@ write_resolv_conf (FILE *f,
>
> str = g_string_new ("");
>
> - if (nameservers) {
> + if (nameservers && g_strv_length (nameservers)) {
> int num = g_strv_length (nameservers);
>
> for (i = 0; i < num; i++) {
> @@ -391,6 +391,14 @@ write_resolv_conf (FILE *f,
> g_string_append (str, nameservers[i]);
> g_string_append_c (str, '\n');
> }
> + } else {
> + g_string_append_printf (str, "\n\n%s%s%s%s%s%s",
> + "# No nameservers found; try putting
> DNS servers into your\n",
> + "# ifcfg files in
> /etc/sysconfig/network-scripts like so:\n",
> + "#\n",
> + "# DNS1=xxx.xxx.xxx.xxx\n",
> + "# DNS2=xxx.xxx.xxx.xxx\n",
> + "# DOMAIN=lab.foo.com bar.foo.com\n");
> }
>
> nameservers_str = g_string_free (str, FALSE);
_______________________________________________
networkmanager-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/networkmanager-list