From 04b73079b4df4adf552e1e55605fea13761f74f7 Mon Sep 17 00:00:00 2001 From: "tarun.kumar" Date: Mon, 3 Feb 2025 18:31:32 +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 a791625cce..3ef4b8daa7 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit a791625ccede2f1afe22dfa3e7a6ebf78e8be4ea +Subproject commit 3ef4b8daa72ee79775447c4032147c951c55e957 diff --git a/components/wpa_supplicant/port/include/os.h b/components/wpa_supplicant/port/include/os.h index b841f84170..f519df0ad4 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");