Skip to content

Commit dca0391

Browse files
committed
bugfix reservation
1 parent 6d41e01 commit dca0391

24 files changed

Lines changed: 38 additions & 15 deletions

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# in this exact order for cmake to work correctly
33
cmake_minimum_required(VERSION 3.16)
44

5-
set(PROJECT_VER "2.4.5")
5+
set(PROJECT_VER "2.4.6")
66
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
77
project(esp32_nat_router)
88

components/dhcpserver/dhcpserver.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,16 @@ static s16_t parse_msg(dhcps_t *dhcps, struct dhcps_msg *m, u16_t len)
11161116
dhcps->client_address.addr = first_address.addr;
11171117
}
11181118

1119+
// Skip IPs that are reserved for a different MAC
1120+
while (dhcps->client_address.addr <= dhcps->dhcps_poll.end_ip.addr &&
1121+
is_ip_reserved_for_other(dhcps->client_address.addr, m->chaddr)) {
1122+
ip4_addr_t tmp;
1123+
tmp.addr = htonl(dhcps->client_address.addr);
1124+
tmp.addr++;
1125+
dhcps->client_address.addr = htonl(tmp.addr);
1126+
ESP_LOGD(TAG, "Skipping IP reserved for another device");
1127+
}
1128+
11191129
// Check for DHCP reservation for this MAC address
11201130
uint32_t reserved_ip = lookup_dhcp_reservation(m->chaddr);
11211131
if (reserved_ip != 0) {

firmware_esp32/bootloader.bin

0 Bytes
Binary file not shown.

firmware_esp32/build_info.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ESP32 NAT Router Build Information
22
=================================
33
Target: ESP32 (Original) (esp32)
4-
Build Time: 2026-03-28 14:49:06
5-
Git Hash: 5527364
4+
Build Time: 2026-03-31 16:36:10
5+
Git Hash: 6d41e01
66
Binary Files: 4
77
Build Directory: build
1.56 KB
Binary file not shown.

firmware_esp32c3/bootloader.bin

0 Bytes
Binary file not shown.

firmware_esp32c3/build_info.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ESP32 NAT Router Build Information
22
=================================
33
Target: ESP32-C3 (esp32c3)
4-
Build Time: 2026-03-28 15:05:43
5-
Git Hash: 5527364
4+
Build Time: 2026-03-31 16:50:31
5+
Git Hash: 6d41e01
66
Binary Files: 4
77
Build Directory: build
1.95 KB
Binary file not shown.

firmware_esp32c5/bootloader.bin

32 Bytes
Binary file not shown.

firmware_esp32c5/build_info.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ESP32 NAT Router Build Information
22
=================================
33
Target: ESP32-C5 (esp32c5)
4-
Build Time: 2026-03-28 14:58:57
5-
Git Hash: 5527364
4+
Build Time: 2026-03-31 16:44:52
5+
Git Hash: 6d41e01
66
Binary Files: 4
77
Build Directory: build

0 commit comments

Comments
 (0)