summaryrefslogtreecommitdiffstats
path: root/kernel/include/linux/netfilter/ipset
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/linux/netfilter/ipset')
-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)
{