diff --git a/sys/include/net/ipv6/addr.h b/sys/include/net/ipv6/addr.h index bbb66aa09497ea9145308649c410fb8abfdd214d..ceb5f8719c37e10f325d1e941a46a6b06b1c4dd7 100644 --- a/sys/include/net/ipv6/addr.h +++ b/sys/include/net/ipv6/addr.h @@ -228,21 +228,6 @@ typedef union { #define IPV6_ADDR_MCAST_SCP_GLOBAL (0xe) /**< global scope */ /** @} */ -/** - * @brief Checks if two IPv6 addresses are equal. - * - * @param[in] a An IPv6 address. - * @param[in] b Another IPv6 address. - * - * @return true, if @p a and @p b are equal - * @return false, otherwise. - */ -static inline bool ipv6_addr_equal(const ipv6_addr_t *a, const ipv6_addr_t *b) -{ - return (a->u64[0].u64 == b->u64[0].u64) && - (a->u64[1].u64 == b->u64[1].u64); -} - /** * @brief Checks if @p addr is unspecified (all zero). * @@ -448,6 +433,17 @@ static inline bool ipv6_addr_is_solicited_node(const ipv6_addr_t *addr) } +/** + * @brief Checks if two IPv6 addresses are equal. + * + * @param[in] a An IPv6 address. + * @param[in] b Another IPv6 address. + * + * @return true, if @p a and @p b are equal + * @return false, otherwise. + */ +bool ipv6_addr_equal(const ipv6_addr_t *a, const ipv6_addr_t *b); + /** * @brief Checks up to which bit-count two IPv6 addresses match in their * prefix. diff --git a/sys/net/network_layer/ipv6/addr/ipv6_addr.c b/sys/net/network_layer/ipv6/addr/ipv6_addr.c index 9f4f9ab0bc4aafd078c18511178d9c86fb8cd870..58eddd303b5a77c026ec42768d118276edf00ff7 100644 --- a/sys/net/network_layer/ipv6/addr/ipv6_addr.c +++ b/sys/net/network_layer/ipv6/addr/ipv6_addr.c @@ -19,6 +19,12 @@ #include "net/ipv6/addr.h" +bool ipv6_addr_equal(const ipv6_addr_t *a, const ipv6_addr_t *b) +{ + return (a->u64[0].u64 == b->u64[0].u64) && + (a->u64[1].u64 == b->u64[1].u64); +} + uint8_t ipv6_addr_match_prefix(const ipv6_addr_t *a, const ipv6_addr_t *b) { uint8_t prefix_len = 0;