Hello,
We were asked to give our product the ability to change the DHCP client hostname. Digging in the Netx Duo DHCP Client documentation, we found that this parameter is provided during the creation of the DHCP client with nx_dhcp_create(). The NetX Duo documentation also provides the option NX_DHCP_CLIENT_ENABLE_HOST_NAME_CHECK to check that the provided hostname follows several required restrictions (the wiki https://en.wikipedia.org/wiki/Hostname provides a good summary). This option is disabled by default.
So we first enabled the option NX_DHCP_CLIENT_ENABLE_HOST_NAME_CHECK and discovered that the check fails with the default hostname provided by the SSP Configurator. For example, here is the auto-generated code we get in our project:
void dhcp_client_init(void)
{
UINT g_dhcp_client_err;
/* Create DHCP client. */
g_dhcp_client_err = nx_dhcp_create (&g_dhcp_client, &g_ip, "g_dhcp_client_DHCPv4");
if (NX_SUCCESS != g_dhcp_client_err)
{
g_dhcp_client_err_callback ((void *) &g_dhcp_client, &g_dhcp_client_err);
}
}
Actually, underscores are illegal in hostnames so the NetX Duo fail result is correct. We could not find a way to change this default name other than modifying this auto-generated file which is not something we want to do. This looks like a bug in the SSP to us.
Is there a workaround we could customize this auto-generated hostname other than modifying this file?
Thanks
Franck