Browse Source

DPP: Remove compiler warnings about signed/unsigned comparisons

These timestamp comparisons did not use matching signedness.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Jouni Malinen 7 years ago
parent
commit
3ca4be1eaa
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/ap/dpp_hostapd.c
  2. 1 1
      wpa_supplicant/dpp_supplicant.c

+ 2 - 2
src/ap/dpp_hostapd.c

@@ -1065,7 +1065,7 @@ static void hostapd_dpp_rx_peer_disc_req(struct hostapd_data *hapd,
 	os_get_time(&now);
 
 	if (hapd->conf->dpp_netaccesskey_expiry &&
-	    hapd->conf->dpp_netaccesskey_expiry < now.sec) {
+	    (os_time_t) hapd->conf->dpp_netaccesskey_expiry < now.sec) {
 		wpa_printf(MSG_INFO, "DPP: Own netAccessKey expired");
 		return;
 	}
@@ -1106,7 +1106,7 @@ static void hostapd_dpp_rx_peer_disc_req(struct hostapd_data *hapd,
 		return;
 	}
 
-	if (!expire || hapd->conf->dpp_netaccesskey_expiry < expire)
+	if (!expire || (os_time_t) hapd->conf->dpp_netaccesskey_expiry < expire)
 		expire = hapd->conf->dpp_netaccesskey_expiry;
 	if (expire)
 		expiration = expire - now.sec;

+ 1 - 1
wpa_supplicant/dpp_supplicant.c

@@ -2235,7 +2235,7 @@ int wpas_dpp_check_connect(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
 	os_get_time(&now);
 
 	if (ssid->dpp_netaccesskey_expiry &&
-	    ssid->dpp_netaccesskey_expiry < now.sec) {
+	    (os_time_t) ssid->dpp_netaccesskey_expiry < now.sec) {
 		wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_MISSING_CONNECTOR
 			"netAccessKey expired");
 		return -1;