提交 cb904b0a 编写于 作者: A Alexander Aring 提交者: Marcel Holtmann

ieee802154: add extended address validation helper

This patch introduce an extended address validation helper to check if
an extended address is valid or not.
Signed-off-by: NAlexander Aring <alex.aring@gmail.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 f59f419d
......@@ -197,4 +197,18 @@ static inline bool ieee802154_is_valid_psdu_len(const u8 len)
return (len >= IEEE802154_MIN_PSDU_LEN && len <= IEEE802154_MTU);
}
/**
* 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)
{
/* 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.
*/
return ((addr != 0x0000000000000000) || (addr != 0xffffffffffffffff));
}
#endif /* LINUX_IEEE802154_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册