From f978e87f3cc20d90e570e7ce93709184d3eefdb1 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Tue, 29 Mar 2022 16:09:26 +0200 Subject: [PATCH] dhcp: Add hook for appending extra client's request options Co-Authored-By: Liu Han (espressif/esp-lwip@ae7edc2a) Ref IDF-4817 --- src/core/ipv4/dhcp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/ipv4/dhcp.c b/src/core/ipv4/dhcp.c index bb4c3cde..7a38502b 100644 --- a/src/core/ipv4/dhcp.c +++ b/src/core/ipv4/dhcp.c @@ -92,6 +92,13 @@ #define LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, offset) do { LWIP_UNUSED_ARG(msg); } while(0) #endif +/** LWIP_HOOK_DHCP_EXTRA_REQUEST_OPTIONS: Additional options added to the list of options + * that the client requests from the servers (opt 55: DHCP_OPTION_PARAMETER_REQUEST_LIST) + */ +#ifndef LWIP_HOOK_DHCP_EXTRA_REQUEST_OPTIONS +#define LWIP_HOOK_DHCP_EXTRA_REQUEST_OPTIONS +#endif + #ifndef DHCP_DEFINE_CUSTOM_TIMEOUTS static inline u32_t timeout_from_offered(u32_t lease, u32_t min, u32_t max) { @@ -197,6 +204,7 @@ static u8_t dhcp_discover_request_options[] = { #if LWIP_DHCP_GET_NTP_SRV , DHCP_OPTION_NTP #endif /* LWIP_DHCP_GET_NTP_SRV */ + LWIP_HOOK_DHCP_EXTRA_REQUEST_OPTIONS }; #ifdef DHCP_GLOBAL_XID