fix(webconfig): read the LAN address after pinning the route
startLanMode() took the caller's IP, read before the route lock. A Wi-Fi/Ethernet switch in between left WebConfig locked to the new link while advertising the old link's address. It now reads the selected link's address after lockSwitching(), as startOTAUpdate() already does.
This commit is contained in:
1 parent
b443aabe6b
commit
44c46ab67f
4 files changed
+6
-6
No files matched your search
@@ -301,7 +301,7 @@ bool WebConfigServer::startSetupMode(char reply[]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WebConfigServer::startLanMode(IPAddress ip, bool initial_setup, char reply[]) {
|
||||
bool WebConfigServer::startLanMode(bool initial_setup, char reply[]) {
|
||||
if (_mode != MODE_OFF || _stopping) {
|
||||
strcpy(reply, "Err: webconfig busy");
|
||||
return false;
|
||||
@@ -313,6 +313,8 @@ bool WebConfigServer::startLanMode(IPAddress ip, bool initial_setup, char reply[
|
||||
}
|
||||
activeNetworkLink().lockSwitching();
|
||||
_network_locked = true;
|
||||
// Read the address only once the route is pinned, so it names the locked link.
|
||||
const IPAddress ip = activeNetworkLink().localIP();
|
||||
if (!activeNetworkLink().isConnected() || ip == IPAddress()) {
|
||||
activeNetworkLink().unlockSwitching();
|
||||
_network_locked = false;
|
||||
|
||||
Reference in new issue
Block a user