gdhcp hostname option support
authorSamuel Ortiz <sameo@linux.intel.com>
Thu, 22 Jul 2010 13:54:58 +0000 (15:54 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 22 Jul 2010 13:54:58 +0000 (15:54 +0200)
gdhcp/client.c
gdhcp/common.c

index 3226392..21b2745 100644 (file)
@@ -1185,7 +1185,7 @@ GDHCPClientError g_dhcp_client_set_send(GDHCPClient *dhcp_client,
        uint8_t *binary_option;
        const char *hostname;
 
-       if (option_code == DHCP_HOST_NAME) {
+       if (option_code == G_DHCP_HOST_NAME) {
                hostname = get_hostname(option_value);
 
                binary_option = alloc_dhcp_option(option_code, hostname, 0);
index 784844b..14fc62c 100644 (file)
@@ -37,6 +37,7 @@ static const DHCPOption client_options[] = {
        { OPTION_IP,                    0x01 }, /* subnet-mask */
        { OPTION_IP | OPTION_LIST,      0x03 }, /* routers */
        { OPTION_IP | OPTION_LIST,      0x06 }, /* domain-name-servers */
+       { OPTION_STRING,                0x0c }, /* hostname */
        { OPTION_STRING,                0x0f }, /* domain-name */
        { OPTION_IP | OPTION_LIST,      0x2a }, /* ntp-servers */
        { OPTION_U32,                   0x33 }, /* dhcp-lease-time */