Ignore resolvers with no interface for resolvconf
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 23 Jan 2010 09:41:48 +0000 (10:41 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 23 Jan 2010 09:41:48 +0000 (10:41 +0100)
plugins/resolvconf.c

index 9067b60..2726a78 100644 (file)
@@ -45,6 +45,9 @@ static int resolvconf_append(const char *interface, const char *domain,
        if (access(RESOLVCONF, X_OK) < 0)
                return -errno;
 
+       if (interface == NULL)
+               return 0;
+
        cmd = g_strdup_printf("echo \"nameserver %s\" | %s -a %s",
                                                server, RESOLVCONF, interface);
 
@@ -65,6 +68,9 @@ static int resolvconf_remove(const char *interface, const char *domain,
 
        DBG("interface %s server %s", interface, server);
 
+       if (interface == NULL)
+               return 0;
+
        cmd = g_strdup_printf("%s -d %s", RESOLVCONF, interface);
 
        DBG("%s", cmd);