]> granicus.if.org Git - esp-idf/commitdiff
dhcp/dhcpserver Fix max station limit check in dhcp server
authorSagar Bijwe <sagar@espressif.com>
Tue, 24 Apr 2018 11:51:52 +0000 (17:21 +0530)
committerSagar Bijwe <sagar@espressif.com>
Tue, 24 Apr 2018 12:06:55 +0000 (17:36 +0530)
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

index d4c48862ca5e023f7432c83607804fbcf79b9697..f43932d4df94c22b6b83f480e6e16412f6d68bf1 100644 (file)
@@ -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();
     }
 }