Blame SOURCES/explain-dns1-dns2.patch

2186fd
diff -up NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c.explain-dns1-dns2 NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c
2186fd
--- NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c.explain-dns1-dns2	2010-10-18 18:44:05.000000000 -0500
2186fd
+++ NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c	2010-11-03 13:51:56.614584001 -0500
2186fd
@@ -358,7 +358,7 @@ write_resolv_conf (FILE *f, const char *
2186fd
 
2186fd
 	str = g_string_new ("");
2186fd
 
2186fd
-	if (nameservers) {
2186fd
+	if (nameservers && g_strv_length (nameservers)) {
2186fd
 		int num = g_strv_length (nameservers);
2186fd
 
2186fd
 		for (i = 0; i < num; i++) {
2186fd
@@ -374,6 +374,14 @@ write_resolv_conf (FILE *f, const char *
2186fd
 			g_string_append (str, nameservers[i]);
2186fd
 			g_string_append_c (str, '\n');
2186fd
 		}
2186fd
+	} else {
2186fd
+		g_string_append_printf (str, "\n\n%s%s%s%s%s%s",
2186fd
+		                        "# No nameservers found; try putting DNS servers into your\n",
2186fd
+		                        "# ifcfg files in /etc/sysconfig/network-scripts like so:\n",
2186fd
+		                        "#\n",
2186fd
+		                        "# DNS1=xxx.xxx.xxx.xxx\n",
2186fd
+		                        "# DNS2=xxx.xxx.xxx.xxx\n",
2186fd
+		                        "# DOMAIN=lab.foo.com bar.foo.com\n");
2186fd
 	}
2186fd
 
2186fd
 	nameservers_str = g_string_free (str, FALSE);