summaryrefslogtreecommitdiff
path: root/gdhcp/client.c
diff options
context:
space:
mode:
authorMartin Xu <martin.xu@intel.com>2010-11-25 14:03:14 +0800
committerSamuel Ortiz <sameo@linux.intel.com>2010-11-25 11:47:52 +0100
commitb220d5fd953c2c8e0db7b145f6da3d1b1d4d3fb5 (patch)
tree48f41fac520e3f79946cfeeb32ed7c06210bf340 /gdhcp/client.c
parentee179cc1006ca57cb3f1942a4d54ca42c1da744c (diff)
downloadconnman-b220d5fd953c2c8e0db7b145f6da3d1b1d4d3fb5.tar.gz
connman-b220d5fd953c2c8e0db7b145f6da3d1b1d4d3fb5.tar.bz2
connman-b220d5fd953c2c8e0db7b145f6da3d1b1d4d3fb5.zip
gdhcp: Support hostname with space characters
Diffstat (limited to 'gdhcp/client.c')
-rw-r--r--gdhcp/client.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c
index 5c5b4263..4e687e99 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -844,7 +844,7 @@ static char *malloc_option_value_string(uint8_t *option, GDHCPOptionType type)
return ret;
}
-static GList *get_option_value_list(char *value)
+static GList *get_option_value_list(char *value, GDHCPOptionType type)
{
char *pos = value;
GList *list = NULL;
@@ -852,6 +852,9 @@ static GList *get_option_value_list(char *value)
if (pos == NULL)
return NULL;
+ if (type == OPTION_STRING)
+ return g_list_append(list, g_strdup(value));
+
while ((pos = strchr(pos, ' ')) != NULL) {
*pos = '\0';
@@ -890,7 +893,7 @@ static void get_request(GDHCPClient *dhcp_client, struct dhcp_packet *packet)
g_hash_table_remove(dhcp_client->code_value_hash,
GINT_TO_POINTER((int) code));
- value_list = get_option_value_list(option_value);
+ value_list = get_option_value_list(option_value, type);
g_free(option_value);