summaryrefslogtreecommitdiffstats
path: root/kernel/include/linux/netfilter
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2018-08-30 10:46:18 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2018-08-30 10:46:18 +0200
commit831c1b709c8834a47419a0f77fd8636145ed05be (patch)
tree944f7eb47ee3b4b9b241dd6d6d8df80419ea0662 /kernel/include/linux/netfilter
parent9998f795bac2611e2a8fabd5dd9c264077c9a980 (diff)
Add compatibility to support is_zero_ether_addr()
Diffstat (limited to 'kernel/include/linux/netfilter')
-rw-r--r--kernel/include/linux/netfilter/ipset/ip_set_compat.h.in14
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
index c78867d..72b77b3 100644
--- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
+++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
@@ -8,6 +8,7 @@
#@HAVE_STRUCT_XT_ACTION_PARAM@ HAVE_STRUCT_XT_ACTION_PARAM
#@HAVE_VZALLOC@ HAVE_VZALLOC
#@HAVE_ETHER_ADDR_EQUAL@ HAVE_ETHER_ADDR_EQUAL
+#@HAVE_IS_ZERO_ETHER_ADDR@ HAVE_IS_ZERO_ETHER_ADDR
#@HAVE_NLA_PUT_BE16@ HAVE_NLA_PUT_BE16
#@HAVE_NLA_PUT_BE64@ HAVE_NLA_PUT_BE64
#@HAVE_NLA_PUT_64BIT@ HAVE_NLA_PUT_64BIT
@@ -152,15 +153,26 @@ do { \
PAGE_KERNEL)
#endif
-#ifndef HAVE_ETHER_ADDR_EQUAL
+#if !defined(HAVE_ETHER_ADDR_EQUAL) || !defined(HAVE_IS_ZERO_ETHER_ADDR)
#include <linux/etherdevice.h>
+#ifndef HAVE_ETHER_ADDR_EQUAL
static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
{
return !compare_ether_addr(addr1, addr2);
}
#endif
+#ifndef HAVE_IS_ZERO_ETHER_ADDR
+static inline bool is_zero_ether_addr(const u8 *addr)
+{
+ return (*(const u16 *)(addr + 0) |
+ *(const u16 *)(addr + 2) |
+ *(const u16 *)(addr + 4)) == 0;
+}
+#endif
+#endif
+
#ifndef HAVE_NLA_PUT_BE64
static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
{