From 21584827b35676da4a93973e70284338b987b185 Mon Sep 17 00:00:00 2001 From: Sagar Bijwe Date: Tue, 24 Apr 2018 17:21:52 +0530 Subject: [PATCH] dhcp/dhcpserver Fix max station limit check in dhcp server Currently when MAX_STATION limit in DHCP config is set to N, dhcp server issues only N-1 IP addresses. This is problematic from customer perspective if both SoftAP MAX_STATION and DHCP MAX_STATION limit is set to same value. With this change DHCP server can issue N addresses that is inline with the set limit. Closes TW<20556> --- components/lwip/apps/dhcpserver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lwip/apps/dhcpserver.c b/components/lwip/apps/dhcpserver.c index d4c48862c..f43932d4d 100644 --- a/components/lwip/apps/dhcpserver.c +++ b/components/lwip/apps/dhcpserver.c @@ -1247,7 +1247,7 @@ void dhcps_coarse_tmr(void) } } - if (num_dhcps_pool >= MAX_STATION_NUM) { + if (num_dhcps_pool > MAX_STATION_NUM) { kill_oldest_dhcps_pool(); } }