From d65681a7d7a13a220c7bab9093c717b151d3719c Mon Sep 17 00:00:00 2001 From: Jasper Verschueren Date: Wed, 4 Jul 2018 10:06:30 +0200 Subject: [PATCH] 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 --- src/core/ipv4/dhcp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/ipv4/dhcp.c b/src/core/ipv4/dhcp.c index 18b809e2..24eb059c 100644 --- a/src/core/ipv4/dhcp.c +++ b/src/core/ipv4/dhcp.c @@ -1286,6 +1286,11 @@ dhcp_reboot(struct netif *netif) 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]); } + +#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); dhcp_option_trailer(options_out_len, msg_out->options, p_out);