From: Jouni Malinen Date: Wed, 2 Oct 2024 21:52:19 +0000 (+0300) Subject: wlantest: Avoid compiler warnings on printing out u64 in 32-bit builds X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d84323d05ef30cdcf343884ac34420caf72145bd;p=thirdparty%2Fhostap.git wlantest: Avoid compiler warnings on printing out u64 in 32-bit builds Signed-off-by: Jouni Malinen --- diff --git a/wlantest/rx_mgmt.c b/wlantest/rx_mgmt.c index 06bc904f6..ecb56e2c9 100644 --- a/wlantest/rx_mgmt.c +++ b/wlantest/rx_mgmt.c @@ -580,8 +580,9 @@ static void rx_mgmt_beacon(struct wlantest *wt, const u8 *data, size_t len) rx_bipn = WPA_GET_LE48(mme + 2); wpa_printf(MSG_DEBUG, "Beacon frame BSSID " MACSTR - " MME KeyID %u BIPN 0x%lx", - MAC2STR(mgmt->bssid), keyid, rx_bipn); + " MME KeyID %u BIPN 0x%llx", + MAC2STR(mgmt->bssid), keyid, + (long long unsigned int) rx_bipn); wpa_hexdump(MSG_MSGDUMP, "MME MIC", mme + 8, mic_len); if (!bss->igtk_len[keyid]) { @@ -593,8 +594,9 @@ static void rx_mgmt_beacon(struct wlantest *wt, const u8 *data, size_t len) if (rx_bipn <= bss->ipn[keyid]) { add_note(wt, MSG_INFO, "BIP replay detected: SA=" MACSTR - " RX BIPN 0x%lx <= 0x%lx", - MAC2STR(mgmt->sa), rx_bipn, bss->ipn[keyid]); + " RX BIPN 0x%llx <= 0x%llx", + MAC2STR(mgmt->sa), (long long unsigned int) rx_bipn, + (long long unsigned int) bss->ipn[keyid]); } if (check_mmie_mic(bss->mgmt_group_cipher, bss->igtk[keyid], @@ -3160,7 +3162,8 @@ static int check_bip(struct wlantest *wt, const u8 *data, size_t len) } rx_ipn = WPA_GET_LE48(mmie + 2); - wpa_printf(MSG_DEBUG, "MME KeyID %u IPN 0x%lx", keyid, rx_ipn); + wpa_printf(MSG_DEBUG, "MME KeyID %u IPN 0x%llx", keyid, + (long long unsigned int) rx_ipn); wpa_hexdump(MSG_MSGDUMP, "MMIE MIC", mmie + 8, mic_len); if (!bss->igtk_len[keyid]) { @@ -3170,8 +3173,9 @@ static int check_bip(struct wlantest *wt, const u8 *data, size_t len) if (rx_ipn <= bss->ipn[keyid]) { add_note(wt, MSG_INFO, "BIP replay detected: SA=" MACSTR - " RX IPN 0x%lx <= 0x%lx", - MAC2STR(mgmt->sa), rx_ipn, bss->ipn[keyid]); + " RX IPN 0x%llx <= 0x%llx", + MAC2STR(mgmt->sa), (long long unsigned int) rx_ipn, + (long long unsigned int) bss->ipn[keyid]); } if (check_mmie_mic(bss->mgmt_group_cipher, bss->igtk[keyid], diff --git a/wlantest/test_vectors.c b/wlantest/test_vectors.c index 3b6d78bc1..6490a7f6d 100644 --- a/wlantest/test_vectors.c +++ b/wlantest/test_vectors.c @@ -364,7 +364,7 @@ static void test_vector_bip(void) "Deauthentication frame\n"); wpa_hexdump(MSG_INFO, "IGTK", igtk, sizeof(igtk)); - wpa_printf(MSG_INFO, "IPN: 0x%lx", ipn); + wpa_printf(MSG_INFO, "IPN: 0x%llx", (long long unsigned int) ipn); wpa_hexdump(MSG_INFO, "Plaintext frame", frame, sizeof(frame)); prot = bip_protect(igtk, sizeof(igtk), frame, sizeof(frame),