diff options
| author | Alexander Aring <alex.aring@gmail.com> | 2014-11-02 15:43:02 -0500 |
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-02 15:52:02 -0500 |
| commit | c28bee84c5c49312befe1b442e1044ac2392d80d (patch) | |
| tree | 61fe1575899086acad0224374b22437e070a1afb /include/linux | |
| parent | a4164eb4dd3f4f2a22f8bf7b26394e8384f3d9a2 (diff) | |
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: Alexander Aring <alex.aring@gmail.com>
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ieee802154.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/ieee802154.h b/include/linux/ieee802154.h index 9da7c011fbba..5d9e7459d94b 100644 --- a/include/linux/ieee802154.h +++ b/include/linux/ieee802154.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #define LINUX_IEEE802154_H | 24 | #define LINUX_IEEE802154_H |
| 25 | 25 | ||
| 26 | #include <linux/types.h> | 26 | #include <linux/types.h> |
| 27 | #include <asm/byteorder.h> | ||
| 27 | 28 | ||
| 28 | #define IEEE802154_MTU 127 | 29 | #define IEEE802154_MTU 127 |
| 29 | #define IEEE802154_MIN_PSDU_LEN 5 | 30 | #define IEEE802154_MIN_PSDU_LEN 5 |
| @@ -208,8 +209,8 @@ static inline bool ieee802154_is_valid_extended_addr(const __le64 addr) | |||
| 208 | * This is currently a workaround because neighbor discovery can't | 209 | * This is currently a workaround because neighbor discovery can't |
| 209 | * deal with short addresses types right now. | 210 | * deal with short addresses types right now. |
| 210 | */ | 211 | */ |
| 211 | return ((addr != 0x0000000000000000ULL) || | 212 | return ((addr != cpu_to_le64(0x0000000000000000ULL)) || |
| 212 | (addr != 0xffffffffffffffffULL)); | 213 | (addr != cpu_to_le64(0xffffffffffffffffULL))); |
| 213 | } | 214 | } |
| 214 | 215 | ||
| 215 | #endif /* LINUX_IEEE802154_H */ | 216 | #endif /* LINUX_IEEE802154_H */ |
