From e7a71f84b1472c1d19cc7fc2c391f48244d56c0d Mon Sep 17 00:00:00 2001 From: "tarun.kumar" Date: Mon, 3 Feb 2025 19:45:44 +0530 Subject: [PATCH] fix(esp_wifi): Modifying os_time_t datatype for platform and compiler independence --- components/esp_wifi/lib | 2 +- components/wpa_supplicant/port/include/os.h | 3 ++- components/wpa_supplicant/src/wps/wps_registrar.c | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 6ab12fda12..f4e74f0fdd 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 6ab12fda1262348bda91cbd08e0b63639019f34f +Subproject commit f4e74f0fddf4e685cb607ae3dbefdd88741e72f3 diff --git a/components/wpa_supplicant/port/include/os.h b/components/wpa_supplicant/port/include/os.h index e022fdce1c..08fd9d88e0 100644 --- a/components/wpa_supplicant/port/include/os.h +++ b/components/wpa_supplicant/port/include/os.h @@ -22,7 +22,8 @@ #include "supplicant_opt.h" #include "esp_wifi.h" -typedef time_t os_time_t; +/* Modifying datatype for platform and compiler independence */ +typedef uint64_t os_time_t; /** * os_sleep - Sleep (sec, usec) diff --git a/components/wpa_supplicant/src/wps/wps_registrar.c b/components/wpa_supplicant/src/wps/wps_registrar.c index a7edf79ff6..462e16c5df 100644 --- a/components/wpa_supplicant/src/wps/wps_registrar.c +++ b/components/wpa_supplicant/src/wps/wps_registrar.c @@ -1209,7 +1209,9 @@ void wps_registrar_probe_req_rx(struct wps_registrar *reg, const u8 *addr, struct os_reltime now, dur; os_get_reltime(&now); os_reltime_sub(&now, ®->pbc_ignore_start, &dur); - if (dur.sec >= 0 && dur.sec < 5) { +#ifdef ESP_SUPPLICANT + if (dur.sec < 5) { +#endif /* ESP_SUPPLICANT */ wpa_printf(MSG_DEBUG, "WPS: Ignore PBC activation " "based on Probe Request from the Enrollee " "that just completed PBC provisioning");