mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
lwip: Add dhcp servers post processing hook
In order to access DHCP messages from clients in different states and possibly to implement custom handlers that alter the current state, e.g. reject a client with specific hostname using NAK.
This commit is contained in:
@@ -955,6 +955,7 @@ static void handle_dhcp(void *arg,
|
||||
u16_t dhcps_msg_cnt = 0;
|
||||
u8_t *p_dhcps_msg = NULL;
|
||||
u8_t *data;
|
||||
s16_t state;
|
||||
|
||||
#if DHCPS_DEBUG
|
||||
DHCPS_LOG("dhcps: handle_dhcp-> receive a packet\n");
|
||||
@@ -1026,7 +1027,12 @@ static void handle_dhcp(void *arg,
|
||||
DHCPS_LOG("dhcps: handle_dhcp-> parse_msg(p)\n");
|
||||
#endif
|
||||
|
||||
switch (parse_msg(pmsg_dhcps, tlen - 240)) {
|
||||
state = parse_msg(pmsg_dhcps, tlen - 240);
|
||||
#ifdef LWIP_HOOK_DHCPS_POST_STATE
|
||||
state = LWIP_HOOK_DHCPS_POST_STATE(pmsg_dhcps, malloc_len, state);
|
||||
#endif /* LWIP_HOOK_DHCPS_POST_STATE */
|
||||
|
||||
switch (state) {
|
||||
case DHCPS_STATE_OFFER://1
|
||||
#if DHCPS_DEBUG
|
||||
DHCPS_LOG("dhcps: handle_dhcp-> DHCPD_STATE_OFFER\n");
|
||||
|
||||
Reference in New Issue
Block a user