in lwip/core/dhcp.c
add this function
#include "user_interface.h"
char* hostname()
{
//the name is your SSID... eventually here you can return any string
// return "ESP8266";
static struct softap_config apConfig;
wifi_softap_get_config(&apConfig);
return apConfig.ssid;
}
and in functions dhcp_select modify, dhcp_renew, dhcp_rebind
change this
#if LWIP_NETIF_HOSTNAME
if (netif->hostname != NULL) {
const char *p = (const char*)netif->hostname;
u8_t namelen = (u8_t)strlen(p);
if (namelen > 0) {
LWIP_ASSERT("DHCP: hostname is too long!", namelen < 255);
dhcp_option(dhcp, DHCP_OPTION_HOSTNAME, namelen);
while (*p) {
dhcp_option_byte(dhcp, *p++);
}
}
}
#endif /* LWIP_NETIF_HOSTNAME */
into this
const char *name = hostname();
u8_t namelen = (u8_t)strlen(name);
if (namelen > 0) {
LWIP_ASSERT("DHCP: hostname is too long!", namelen < 255);
dhcp_option(dhcp, DHCP_OPTION_HOSTNAME, namelen);
while (*name) {
dhcp_option_byte(dhcp, *name++);
}
}