Skip to content

Commit 18975ca

Browse files
committed
dhcp_discover: add hostname option
ref: esp8266/Arduino#8247
1 parent 5919b91 commit 18975ca

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

glue-lwip/arduino/lwipopts.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3592,8 +3592,13 @@ extern void lwip_hook_dhcp_parse_option(struct netif *netif, struct dhcp *dhcp,
35923592
int option_value_offset);
35933593

35943594
#if LWIP_FEATURES
3595-
#define LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, option_len_ptr) \
3596-
lwip_hook_dhcp_amend_options(netif, dhcp, state, msg, msg_type, option_len_ptr)
3595+
#define LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, option_len_ptr) { \
3596+
/* https://github.com/esp8266/Arduino/issues/8223 */ \
3597+
lwip_hook_dhcp_amend_options(netif, dhcp, state, msg, msg_type, option_len_ptr); \
3598+
/* https://github.com/esp8266/Arduino/issues/8247 */ \
3599+
if ((msg_type) == DHCP_DISCOVER) \
3600+
*(option_len_ptr) = dhcp_option_hostname(*(option_len_ptr), (msg)->options, netif); \
3601+
}
35973602

35983603
extern void lwip_hook_dhcp_amend_options(struct netif *netif, struct dhcp *dhcp, int state, struct dhcp_msg *msg,
35993604
int msg_type, u16 *option_len_ptr);

0 commit comments

Comments
 (0)