aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ieee802154.h
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2015-05-28 15:38:43 +0300
committerMarcel Holtmann <marcel@holtmann.org>2015-05-31 13:40:53 +0200
commitdaf4e2c89254ed6eb8cf7ef60f614edebfdb9f3a (patch)
treefd72d07f8db81663f8b0197bff3e5fde351f3988 /include/linux/ieee802154.h
parentieee802154: Fix generation of random EUI-64 addresses. (diff)
downloadlinux-dev-daf4e2c89254ed6eb8cf7ef60f614edebfdb9f3a.tar.xz
linux-dev-daf4e2c89254ed6eb8cf7ef60f614edebfdb9f3a.zip
ieee802154: Fix EUI-64 station address validation.
Refuse to allow setting an EUI-64 group address as an interface address, as those are not valid station addresses. Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Acked-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/linux/ieee802154.h')
-rw-r--r--include/linux/ieee802154.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/linux/ieee802154.h b/include/linux/ieee802154.h
index 552210d0a46f..1dc1f4ed4001 100644
--- a/include/linux/ieee802154.h
+++ b/include/linux/ieee802154.h
@@ -225,15 +225,13 @@ static inline bool ieee802154_is_valid_psdu_len(const u8 len)
* ieee802154_is_valid_psdu_len - check if extended addr is valid
* @addr: extended addr to check
*/
-static inline bool ieee802154_is_valid_extended_addr(const __le64 addr)
+static inline bool ieee802154_is_valid_extended_unicast_addr(const __le64 addr)
{
- /* These EUI-64 addresses are reserved by IEEE. 0xffffffffffffffff
- * is used internally as extended to short address broadcast mapping.
- * This is currently a workaround because neighbor discovery can't
- * deal with short addresses types right now.
+ /* Bail out if the address is all zero, or if the group
+ * address bit is set.
*/
return ((addr != cpu_to_le64(0x0000000000000000ULL)) &&
- (addr != cpu_to_le64(0xffffffffffffffffULL)));
+ !(addr & cpu_to_le64(0x0100000000000000ULL)));
}
/**