summaryrefslogtreecommitdiff
path: root/plugins/loopback.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-05-12 17:09:20 +0200
committerMarcel Holtmann <marcel@holtmann.org>2010-05-12 17:09:20 +0200
commit49fb5a015eb88cbbcaf89d49ac11ab2eb3d68b7e (patch)
treed9e2e5db9f0f14946354aa84e35a3fea36ca4582 /plugins/loopback.c
parent3e6995b377ef331e8e15267f6be357e7a958203a (diff)
downloadconnman-49fb5a015eb88cbbcaf89d49ac11ab2eb3d68b7e.tar.gz
connman-49fb5a015eb88cbbcaf89d49ac11ab2eb3d68b7e.tar.bz2
connman-49fb5a015eb88cbbcaf89d49ac11ab2eb3d68b7e.zip
Ignore invalid hostname provided by DHCP server
Diffstat (limited to 'plugins/loopback.c')
-rw-r--r--plugins/loopback.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/loopback.c b/plugins/loopback.c
index 9c5e4bf3..94059e05 100644
--- a/plugins/loopback.c
+++ b/plugins/loopback.c
@@ -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);