Security improvement: Support wifi ap_timeout=0s (disable) (#5887)

This commit is contained in:
Fabio Pugliese Ornellas 2023-12-04 23:50:01 +00:00 committed by GitHub
parent 657a7070cb
commit b8fe4f8d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,7 +164,7 @@ void WiFiComponent::loop() {
#ifdef USE_WIFI_AP #ifdef USE_WIFI_AP
if (this->has_ap() && !this->ap_setup_) { if (this->has_ap() && !this->ap_setup_) {
if (now - this->last_connected_ > this->ap_timeout_) { if (this->ap_timeout_ != 0 && (now - this->last_connected_ > this->ap_timeout_)) {
ESP_LOGI(TAG, "Starting fallback AP!"); ESP_LOGI(TAG, "Starting fallback AP!");
this->setup_ap_config_(); this->setup_ap_config_();
#ifdef USE_CAPTIVE_PORTAL #ifdef USE_CAPTIVE_PORTAL