This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Get HOSTNAME from DHCP

Hi, 

I am using NDK 2.0.0 on DM6421.  I want to get Hostname from DHCP (option 21) so I configured my DHCP server to provide a predefined hostname to the HW address of my board. To do this I added the:

DHCPOPT_HOSTNAME

to the DHCP request.

Observing what the DHCP server sends to the cliend (Wireshark) I see the desired hostname is sent to the client.  
The problem is that the hostname provided by the server is not acquired by the client and 

rc = CfgGetImmediate( 0, CFGTAG_SYSINFO, DHCPOPT_HOSTNAME,
1, sizeof(HostnameString), (UINT8 *)&HostnameString );

returns always 0.

This comment I found on the examples suggest the hostname is not set during an DHCP negotiation:

// Note that the DHCP client will erase all CFGTAG_SYSINFO tags except
// CFGITEM_DHCP_HOSTNAME. If the application needs to keep manual
// entries in the DHCP tag range, then the code to maintain them should
// be placed here.

How can I set the hostname provided by DHCP?