]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
radiotap: Silence sparse warnings about byte order swapping
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 23 Jun 2016 15:06:37 +0000 (18:06 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 23 Jun 2016 15:08:11 +0000 (18:08 +0300)
These little endian fields were not marked properly and the type case in
the get_unaligned_* helper macros were causing warnings from sparse.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/drivers/driver_nl80211_monitor.c
src/utils/platform.h
src/utils/radiotap.c
src/utils/radiotap.h
src/utils/radiotap_iter.h

index 45385da91f6a1981c326b693774b491d94389764..9376d1143800df0d53177402e668a19d8f73afdd 100644 (file)
@@ -136,7 +136,7 @@ static void handle_monitor_read(int sock, void *eloop_ctx, void *sock_ctx)
                        break;
                case IEEE80211_RADIOTAP_TX_FLAGS:
                        injected = 1;
-                       failed = le_to_host16((*(uint16_t *) iter.this_arg)) &
+                       failed = le_to_host16((*(le16 *) iter.this_arg)) &
                                        IEEE80211_RADIOTAP_F_TX_FAIL;
                        break;
                case IEEE80211_RADIOTAP_DATA_RETRIES:
index 46cfe785e180607ce4cf519d8c49d866abeef1e7..813987eb660648cf17d6d6e1b656648220e5922e 100644 (file)
@@ -15,7 +15,7 @@
                                                                \
        __ptr->__val;                                           \
 })
-#define get_unaligned_le16(p)  le16_to_cpu(get_unaligned((uint16_t *)(p)))
-#define get_unaligned_le32(p)  le32_to_cpu(get_unaligned((uint32_t *)(p)))
+#define get_unaligned_le16(p)  le16_to_cpu(get_unaligned((le16 *)(p)))
+#define get_unaligned_le32(p)  le32_to_cpu(get_unaligned((le32 *)(p)))
 
 #endif /* PLATFORM_H */
index c9a5023355922939ccf5c8d0723dbbcf06f9d402..71996eb7908f5e29b9a48f25ee03336d2a250917 100644 (file)
@@ -13,8 +13,8 @@
  *
  * See COPYING for more details.
  */
-#include "radiotap_iter.h"
 #include "platform.h"
+#include "radiotap_iter.h"
 
 /* function prototypes and related defs are in radiotap_iter.h */
 
index 0572e7c963da75d6b7a94bbdb35aa88a1c0d9529..460af23d8124657c22d0996656cbe7b4be840fd9 100644 (file)
@@ -65,12 +65,12 @@ struct ieee80211_radiotap_header {
                                 * new fields does not count.
                                 */
        uint8_t it_pad;
-       uint16_t it_len;        /* length of the whole
+       le16 it_len;            /* length of the whole
                                 * header in bytes, including
                                 * it_version, it_pad,
                                 * it_len, and data fields.
                                 */
-       uint32_t it_present;    /* A bitmap telling which
+       le32 it_present;        /* A bitmap telling which
                                 * fields are present. Set bit 31
                                 * (0x80000000) to extend the
                                 * bitmap by another 32 bits.
index b768c85baace583963348794f79eb1b7cf6f5a19..6ea07e3b1b83fedea4b7dd170681c92c341aff6b 100644 (file)
@@ -67,7 +67,7 @@ struct ieee80211_radiotap_iterator {
        const struct ieee80211_radiotap_namespace *current_namespace;
 
        unsigned char *_arg, *_next_ns_data;
-       uint32_t *_next_bitmap;
+       le32 *_next_bitmap;
 
        unsigned char *this_arg;
 #ifdef RADIOTAP_SUPPORT_OVERRIDES