Browse Source

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>
STABLE-2_1_x
Jasper Verschueren 8 years ago committed by Simon Goldschmidt
parent
commit
d65681a7d7
  1. 5
      src/core/ipv4/dhcp.c

5
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);

Loading…
Cancel
Save