mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-09 00:53:37 +08:00
dhcp: Set hostname for DISCOVER packets
If the hostname is not set in the DISCOVER packet, then some servers might issue an OFFER with hostname configured and consequently reject the REQUEST with any other hostname. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Co-Authored-By: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
committed by
Simon Goldschmidt
parent
5231c8da23
commit
90b2a6b4c4
@@ -1031,6 +1031,10 @@ dhcp_discover(struct netif *netif)
|
||||
options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
|
||||
options_out_len = dhcp_option_short(options_out_len, msg_out->options, DHCP_MAX_MSG_LEN(netif));
|
||||
|
||||
#if LWIP_NETIF_HOSTNAME && LWIP_DHCP_DISCOVER_ADD_HOSTNAME
|
||||
options_out_len = dhcp_option_hostname(options_out_len, msg_out->options, netif);
|
||||
#endif /* LWIP NETIF HOSTNAME && LWIP_DHCP_DISCOVER_ADD_HOSTNAME */
|
||||
|
||||
options_out_len = dhcp_option(options_out_len, msg_out->options, DHCP_OPTION_PARAMETER_REQUEST_LIST, LWIP_ARRAYSIZE(dhcp_discover_request_options));
|
||||
for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) {
|
||||
options_out_len = dhcp_option_byte(options_out_len, msg_out->options, dhcp_discover_request_options[i]);
|
||||
|
||||
Reference in New Issue
Block a user