DHCP request send on reboot does not contain hostname option

When the network is changed, dhcp is rebooted.
It will send a dhcp request again to verify it's lease.

DHCP requests are send out in selecting state, rebinding, renewing
and rebooting. But in the rebooting state the hostname option is
not included. This means that after reboot, the hostname will be
unknown to the DNS.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
Jasper Verschueren 2018-07-04 10:06:30 +02:00 committed by Simon Goldschmidt
parent 7b8a784c4f
commit d65681a7d7

View File

@ -1286,6 +1286,11 @@ dhcp_reboot(struct netif *netif)
for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { 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]); options_out_len = dhcp_option_byte(options_out_len, msg_out->options, dhcp_discover_request_options[i]);
} }
#if LWIP_NETIF_HOSTNAME
options_out_len = dhcp_option_hostname(options_out_len, msg_out->options, netif);
#endif /* LWIP_NETIF_HOSTNAME */
LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, DHCP_STATE_REBOOTING, msg_out, DHCP_REQUEST, &options_out_len); LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, DHCP_STATE_REBOOTING, msg_out, DHCP_REQUEST, &options_out_len);
dhcp_option_trailer(options_out_len, msg_out->options, p_out); dhcp_option_trailer(options_out_len, msg_out->options, p_out);