summary refs log tree commit diff
path: root/src/dns-manager
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2011-11-12 01:36:14 +0100
committerMichael Biebl <biebl@debian.org>2011-11-12 01:36:14 +0100
commitb436a68a20ff3114ded32a7a3d70cdd4954039f9 (patch)
tree3e7d6971c35b47b6e67604f54d434d909be0f228 /src/dns-manager
parent485d149fe80915d94ed49ea6c2c0552cf7a3e79a (diff)
Imported Upstream version 0.9.2.0 upstream/0.9.2.0
Diffstat (limited to 'src/dns-manager')
-rw-r--r--src/dns-manager/Makefile.in2
-rw-r--r--src/dns-manager/nm-dns-manager.c21
2 files changed, 15 insertions, 8 deletions
diff --git a/src/dns-manager/Makefile.in b/src/dns-manager/Makefile.in
index d44c3bfc..571f585b 100644
--- a/src/dns-manager/Makefile.in
+++ b/src/dns-manager/Makefile.in
@@ -153,6 +153,8 @@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@
 GNUTLS_LIBS = @GNUTLS_LIBS@
 GREP = @GREP@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
 GUDEV_CFLAGS = @GUDEV_CFLAGS@
diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c
index 0203f2bb..ddfd47c8 100644
--- a/src/dns-manager/nm-dns-manager.c
+++ b/src/dns-manager/nm-dns-manager.c
@@ -1097,15 +1097,20 @@ dispose (GObject *object)
 		g_slist_free (priv->plugins);
 		priv->plugins = NULL;
 
-		/* If we're quitting leave a valid resolv.conf in place, not one
-		 * pointing to 127.0.0.1 if any plugins were active.  Thus update
-		 * DNS after disposing of all plugins.
+		/* If last_iface is NULL, this means we haven't done a DNS update before,
+		 * so no reason to try and take down entries from resolv.conf.
 		 */
-		if (!update_dns (self, priv->last_iface, TRUE, &error)) {
-			nm_log_warn (LOGD_DNS, "could not commit DNS changes on shutdown: (%d) %s",
-					     error ? error->code : -1,
-					     error && error->message ? error->message : "(unknown)");
-			g_clear_error (&error);
+		if (priv->last_iface != NULL) {
+			/* If we're quitting leave a valid resolv.conf in place, not one
+			 * pointing to 127.0.0.1 if any plugins were active.  Thus update
+			 * DNS after disposing of all plugins.
+			 */
+			if (!update_dns (self, priv->last_iface, TRUE, &error)) {
+				nm_log_warn (LOGD_DNS, "could not commit DNS changes on shutdown: (%d) %s",
+				             error ? error->code : -1,
+				             error && error->message ? error->message : "(unknown)");
+				g_clear_error (&error);
+			}
 		}
 
 		g_slist_foreach (priv->configs, (GFunc) g_object_unref, NULL);