Skip to content

Commit

Permalink
Regression fix for split networking by reintroducing the DHCP code wi…
Browse files Browse the repository at this point in the history
…th the non-routable 0.0.0.0 gateway. Ooops.
  • Loading branch information
Brian Mathews authored and Brian Mathews committed Sep 30, 2024
1 parent 85b2384 commit 30bc0b4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion firmware/webtools/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SOTACAT for Elecraft KX2 and KX3",
"version": "2024-09-22_23:09-Debug",
"version": "2024-09-29_21:24-Release",
"builds": [
{
"chipFamily": "ESP32-C3",
Expand Down
2 changes: 1 addition & 1 deletion include/build_info.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_DATE_TIME "240922:2309"
#define BUILD_DATE_TIME "240929:2124"
12 changes: 12 additions & 0 deletions src/wifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,18 @@ void wifi_task (void * pvParameters) {
ESP_LOGI (TAG8, "Initial connection established, setup task notified");
}

// Re-add the DHCP server reconfiguration logic
if (s_ap_client_connected && !s_dhcp_configured) {
esp_netif_ip_info_t ip_info;
IP4_ADDR (&ip_info.ip, 192, 168, 4, 1);
IP4_ADDR (&ip_info.gw, 0, 0, 0, 0); // Set gateway to 0.0.0.0 to indicate no internet route
IP4_ADDR (&ip_info.netmask, 255, 255, 255, 0);
ESP_ERROR_CHECK (esp_netif_dhcps_stop (ap_netif));
ESP_ERROR_CHECK (esp_netif_set_ip_info (ap_netif, &ip_info));
ESP_ERROR_CHECK (esp_netif_dhcps_start (ap_netif));
s_dhcp_configured = true;
ESP_LOGI (TAG8, "AP mode: DHCP server reconfigured with non-routable gateway");
}
break;
}

Expand Down

0 comments on commit 30bc0b4

Please sign in to comment.