From 52409fae3e4b8d16b68b61902fc09075cd97b75d Mon Sep 17 00:00:00 2001 From: Dominik Sliwa Date: Sun, 2 Jul 2017 16:41:37 +0200 Subject: Backports generated from 4.11 kernel Initial commit. Signed-off-by: Dominik Sliwa --- backport-include/net/addrconf.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 backport-include/net/addrconf.h (limited to 'backport-include/net/addrconf.h') diff --git a/backport-include/net/addrconf.h b/backport-include/net/addrconf.h new file mode 100644 index 0000000..f1e8e62 --- /dev/null +++ b/backport-include/net/addrconf.h @@ -0,0 +1,25 @@ +#ifndef _BACKPORT_NET_ADDRCONF_H +#define _BACKPORT_NET_ADDRCONF_H 1 + +#include_next + +#include + +#if LINUX_VERSION_IS_LESS(3,9,0) +static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr) +{ +#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 + __u64 *p = (__u64 *)addr; + return ((p[0] ^ cpu_to_be64(0xff02000000000000UL)) | + ((p[1] ^ cpu_to_be64(0x00000001ff000000UL)) & + cpu_to_be64(0xffffffffff000000UL))) == 0UL; +#else + return ((addr->s6_addr32[0] ^ htonl(0xff020000)) | + addr->s6_addr32[1] | + (addr->s6_addr32[2] ^ htonl(0x00000001)) | + (addr->s6_addr[12] ^ 0xff)) == 0; +#endif +} +#endif /* LINUX_VERSION_IS_LESS(3,9,0) */ + +#endif /* _BACKPORT_NET_ADDRCONF_H */ -- cgit v1.2.3