projects
/
framework
/
connectivity
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ee179cc
)
gdhcp: Support hostname with space characters
author
Martin Xu
<martin.xu@intel.com>
Thu, 25 Nov 2010 06:03:14 +0000
(14:03 +0800)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Thu, 25 Nov 2010 10:47:52 +0000
(11:47 +0100)
gdhcp/client.c
patch
|
blob
|
history
diff --git
a/gdhcp/client.c
b/gdhcp/client.c
index
5c5b426
..
4e687e9
100644
(file)
--- 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;
}
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;
{
char *pos = value;
GList *list = NULL;
@@
-852,6
+852,9
@@
static GList *get_option_value_list(char *value)
if (pos == NULL)
return NULL;
if (pos == NULL)
return NULL;
+ if (type == OPTION_STRING)
+ return g_list_append(list, g_strdup(value));
+
while ((pos = strchr(pos, ' ')) != NULL) {
*pos = '\0';
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));
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);
g_free(option_value);