Checks whether the supplied IPv6 address is a link local address.
This will have a caller in a future commit.
Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
taddr->be16[7] = ea.be16[2];
}
+/* Returns true if 'addr' is a link local address. Otherwise, false. */
+static inline bool
+in6_is_lla(struct in6_addr *addr)
+{
+#ifdef s6_addr32
+ return addr->s6_addr32[0] == htonl(0xfe800000) && !(addr->s6_addr32[1]);
+#else
+ return addr->s6_addr[0] == htons(0xfe80) &&
+ !(addr->s6_addr[1] | addr->s6_addr[2] | addr->s6_addr[3]);
+#endif
+}
+
static inline void
ipv6_multicast_to_ethernet(struct eth_addr *eth, const struct in6_addr *ip6)
{