summaryrefslogtreecommitdiff
path: root/src/dhcp.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-07-29 19:05:51 -0700
committerMarcel Holtmann <marcel@holtmann.org>2010-07-29 19:05:51 -0700
commitfdd5851b672523bbc976d1ae787926a80e6e0ecf (patch)
tree1a90f2d5e98301ff6be6721b6a549b0b4cc0819e /src/dhcp.c
parent742468fb58a593e15f7bf0029f31fb3104008819 (diff)
downloadconnman-fdd5851b672523bbc976d1ae787926a80e6e0ecf.tar.gz
connman-fdd5851b672523bbc976d1ae787926a80e6e0ecf.tar.bz2
connman-fdd5851b672523bbc976d1ae787926a80e6e0ecf.zip
Store host and domain names retrieved from DHCP
Diffstat (limited to 'src/dhcp.c')
-rw-r--r--src/dhcp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dhcp.c b/src/dhcp.c
index e8bab4fb..6fccc3cb 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -124,8 +124,12 @@ void connman_dhcp_set_value(struct connman_dhcp *dhcp,
dhcp->element->ipv4.nameserver = g_strdup(nameservers[0]);
g_strfreev(nameservers);
} else if (g_strcmp0(key, "Domainname") == 0) {
+ g_free(dhcp->element->domainname);
+ dhcp->element->domainname = g_strdup(value);
__connman_utsname_set_domainname(value);
} else if (g_strcmp0(key, "Hostname") == 0) {
+ g_free(dhcp->element->hostname);
+ dhcp->element->hostname = g_strdup(value);
__connman_utsname_set_hostname(value);
} else if (g_strcmp0(key, "Timeserver") == 0) {
g_free(dhcp->element->ipv4.timeserver);