diff --git a/include/net/net_ip.h b/include/net/net_ip.h index 61eccba7033..ecc7f3d3eb4 100644 --- a/include/net/net_ip.h +++ b/include/net/net_ip.h @@ -763,6 +763,18 @@ static inline bool net_ipv6_is_ll_addr(const struct in6_addr *addr) return UNALIGNED_GET(&addr->s6_addr16[0]) == htons(0xFE80); } +/** + * @brief Check if the given IPv6 address is a unique local address. + * + * @param addr A valid pointer on an IPv6 address + * + * @return True if it is, false otherwise. + */ +static inline bool net_ipv6_is_ula_addr(const struct in6_addr *addr) +{ + return addr->s6_addr[0] == 0xFD; +} + /** * @brief Return pointer to any (all bits zeros) IPv6 address. *