{
GDHCPClient *dhcp_client;
GDHCPClientError error;
+ const char *hostname;
int index;
DBG("dhcp %p", dhcp);
if (getenv("CONNMAN_DHCP_DEBUG"))
g_dhcp_client_set_debug(dhcp_client, dhcp_debug, "DHCP");
- g_dhcp_client_set_send(dhcp_client, G_DHCP_HOST_NAME,
- connman_utsname_get_hostname());
+ hostname = connman_utsname_get_hostname();
+ if (hostname != NULL)
+ g_dhcp_client_set_send(dhcp_client, G_DHCP_HOST_NAME, hostname);
g_dhcp_client_set_request(dhcp_client, G_DHCP_HOST_NAME);
g_dhcp_client_set_request(dhcp_client, G_DHCP_SUBNET);