currently the DHCP hostname for lwIP is always set to "lwip". I'd like to suggest making it configurable via a preprocessor definition:
Current code in lwipthread.c:
Code: Select all
#if LWIP_NETIF_HOSTNAME
/* Initialize interface hostname */
netif->hostname = "lwip";
#endif /* LWIP_NETIF_HOSTNAME */
I'd suggest using an optional preprocessor definition like this:
Code: Select all
#if LWIP_NETIF_HOSTNAME
/* Initialize interface hostname */
#ifdef CHIBIOS_NETIF_HOSTNAME
netif->hostname = CHIBIOS_NETIF_HOSTNAME;
#else
netif->hostname = "lwip";
#endif
#endif /* LWIP_NETIF_HOSTNAME */
CHIBIOS_NETIF_HOSTNAME could then be defined in chconf.h. Another option would be to name the preprocessor definition LWIP_NETIF_HOSTNAME, but as far as I understand it, this would mean changing the standard lwipopts.h.
Please feel free to comment on this.
Best regards, Uli