Commit c28bee84 authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann

ieee802154: fix byteorder issues

This patch fix byteorder issues which occurs because we compare __le64
with an host byteorder value. Simple add a cpu_to_le64 to convert the
host byteorder values to __le64.
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Reported-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent a4164eb4
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#define LINUX_IEEE802154_H #define LINUX_IEEE802154_H
#include <linux/types.h> #include <linux/types.h>
#include <asm/byteorder.h>
#define IEEE802154_MTU 127 #define IEEE802154_MTU 127
#define IEEE802154_MIN_PSDU_LEN 5 #define IEEE802154_MIN_PSDU_LEN 5
...@@ -208,8 +209,8 @@ static inline bool ieee802154_is_valid_extended_addr(const __le64 addr) ...@@ -208,8 +209,8 @@ static inline bool ieee802154_is_valid_extended_addr(const __le64 addr)
* This is currently a workaround because neighbor discovery can't * This is currently a workaround because neighbor discovery can't
* deal with short addresses types right now. * deal with short addresses types right now.
*/ */
return ((addr != 0x0000000000000000ULL) || return ((addr != cpu_to_le64(0x0000000000000000ULL)) ||
(addr != 0xffffffffffffffffULL)); (addr != cpu_to_le64(0xffffffffffffffffULL)));
} }
#endif /* LINUX_IEEE802154_H */ #endif /* LINUX_IEEE802154_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment