From 14bba8e365d1401d72e145ca2d34eae9e64b4152 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 23 Mar 2022 13:09:03 +0100 Subject: [PATCH] dhcp: Add post_init hook to allow skip discovery This enables embedded devices restart the DHCP state machine easily after reset and continue directly with DHCP_BIND of previously bound address. Co-Authored-By: MartinValik (espressif/esp-lwip@3b88e84f) Ref IDF-4817 --- src/core/ipv4/dhcp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/ipv4/dhcp.c b/src/core/ipv4/dhcp.c index 76b9f682..503ceea9 100644 --- a/src/core/ipv4/dhcp.c +++ b/src/core/ipv4/dhcp.c @@ -795,6 +795,12 @@ dhcp_start(struct netif *netif) return ERR_OK; } +#ifdef LWIP_HOOK_DHCP_POST_INIT + if (LWIP_HOOK_DHCP_POST_INIT(netif, result)) { + return result; + } +#endif + /* (re)start the DHCP negotiation */ result = dhcp_discover(netif); if (result != ERR_OK) {