Ignore invalid hostname provided by DHCP server
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 12 May 2010 15:09:20 +0000 (17:09 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 12 May 2010 15:09:20 +0000 (17:09 +0200)
plugins/loopback.c

index 9c5e4bf..94059e0 100644 (file)
@@ -283,6 +283,9 @@ static int loopback_set_hostname(const char *hostname)
 {
        int err;
 
+       if (g_strcmp0(hostname, "<hostname>") == 0)
+               return 0;
+
        if (sethostname(hostname, strlen(hostname)) < 0) {
                err = -errno;
                connman_error("Failed to set hostname to %s", hostname);