lwip: Fix DHCP Server to remove clients record if request not acked

When client's request refused by sending NAK, its record still resided
in the linked list of pooled addresses. It is okay from the spec
perspective (RFC2131.p16: Server MAY mark the offered address
unavailable), but would consume some memory if the client didn't retry.

Closes https://github.com/espressif/esp-idf/issues/6410
This commit is contained in:
David Cermak
2021-01-22 09:29:21 +01:00
committed by bot
parent 8d476269d6
commit 96911fb7ea

View File

@@ -916,7 +916,7 @@ POOL_CHECK:
s16_t ret = parse_options(&m->options[4], len);; s16_t ret = parse_options(&m->options[4], len);;
if (ret == DHCPS_STATE_RELEASE) { if (ret == DHCPS_STATE_RELEASE || ret == DHCPS_STATE_NAK) {
if (pnode != NULL) { if (pnode != NULL) {
node_remove_from_list(&plist, pnode); node_remove_from_list(&plist, pnode);
free(pnode); free(pnode);