Fix issue with adding nameserver that doesn't exist
authorMohamed Abbas <mohamed.abbas@intel.com>
Thu, 8 Oct 2009 18:49:13 +0000 (11:49 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 3 Nov 2009 06:58:40 +0000 (15:58 +0900)
src/ipv4.c

index b98d302..01a430a 100644 (file)
@@ -97,8 +97,8 @@ static int set_ipv4(struct connman_element *element,
 
        if (nameserver == NULL)
                connman_error("No nameserver for %s defined", ifr.ifr_name);
-
-       connman_resolver_append(ifr.ifr_name, NULL, nameserver);
+       else
+               connman_resolver_append(ifr.ifr_name, NULL, nameserver);
 
        return 0;
 }