]> granicus.if.org Git - ipset/commitdiff
Compatibility: include linux/export.h when needed
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Wed, 28 Oct 2015 16:14:28 +0000 (17:14 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Wed, 28 Oct 2015 16:14:28 +0000 (17:14 +0100)
kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
kernel/net/netfilter/ipset/ip_set_getport.c
kernel/net/netfilter/ipset/pfxlen.c

index d2cab54535b14a333e3f3075ca2452ce6a3fd0e6..33f14eb7497b64d57eaff5f403f910c464e5eef5 100644 (file)
@@ -1,24 +1,9 @@
 #ifndef __IP_SET_COMPAT_H
 #define __IP_SET_COMPAT_H
 
-#ifndef CONFIG_IP_SET_MAX
-#ifdef IP_SET_MAX
-#define CONFIG_IP_SET_MAX      IP_SET_MAX
-#else
-#define CONFIG_IP_SET_MAX      256
-#endif
-#endif
-
-#ifndef IS_ENABLED
-#define __X_ARG_PLACEHOLDER_1 0,
-#define x_config_enabled(cfg) _x_config_enabled(cfg)
-#define _x_config_enabled(value) __x_config_enabled(__X_ARG_PLACEHOLDER_##value)
-#define __x_config_enabled(arg1_or_junk) ___x_config_enabled(arg1_or_junk 1, 0)
-#define ___x_config_enabled(__ignored, val, ...) val
-
-#define IS_ENABLED(option) \
-       (x_config_enabled(option) || x_config_enabled(option##_MODULE))
-#endif
+/* Not everything could be moved here. Compatibility stuffs can be found in
+ * xt_set.c, ip_set_core.c, ip_set_getport.c, pfxlen.c too.
+ */
 
 #@HAVE_STRUCT_XT_ACTION_PARAM@ HAVE_STRUCT_XT_ACTION_PARAM
 #@HAVE_VZALLOC@ HAVE_VZALLOC
 #@HAVE_NF_BRIDGE_GET_PHYSDEV@ HAVE_NF_BRIDGE_GET_PHYSDEV
 #@HAVE_NLA_PUT_IN_ADDR@ HAVE_NLA_PUT_IN_ADDR
 
-/* Not everything could be moved here. Compatibility stuffs can be found in
- * xt_set.c, ip_set_core.c, ip_set_getport.c, pfxlen.c too.
- */
+#ifdef HAVE_EXPORT_H
+#include <linux/export.h>
+#endif
+
+#ifndef IP_SET_COMPAT_HEADERS
+
+#ifndef CONFIG_IP_SET_MAX
+#ifdef IP_SET_MAX
+#define CONFIG_IP_SET_MAX      IP_SET_MAX
+#else
+#define CONFIG_IP_SET_MAX      256
+#endif
+#endif
+
+#ifndef IS_ENABLED
+#define __X_ARG_PLACEHOLDER_1 0,
+#define x_config_enabled(cfg) _x_config_enabled(cfg)
+#define _x_config_enabled(value) __x_config_enabled(__X_ARG_PLACEHOLDER_##value)
+#define __x_config_enabled(arg1_or_junk) ___x_config_enabled(arg1_or_junk 1, 0)
+#define ___x_config_enabled(__ignored, val, ...) val
+
+#define IS_ENABLED(option) \
+       (x_config_enabled(option) || x_config_enabled(option##_MODULE))
+#endif
 
 #include <linux/version.h>
 #include <linux/netlink.h>
@@ -263,4 +269,5 @@ static inline int nla_put_in6_addr(struct sk_buff *skb, int attrtype,
 #define SIZE_MAX       (~(size_t)0)
 #endif
 
+#endif /* IP_SET_COMPAT_HEADERS */
 #endif /* __IP_SET_COMPAT_H */
index b82f7690630a83828636109e5978febceb45887f..528e94cf2b26e489debd60e67282311680f5af94 100644 (file)
@@ -8,9 +8,6 @@
 /* Get Layer-4 data from the packets */
 
 #include <linux/version.h>
-#ifdef HAVE_EXPORT_H
-#include <linux/export.h>
-#endif
 #include <linux/ip.h>
 #include <linux/skbuff.h>
 #include <linux/icmp.h>
index 41c7f44b98345c06da7c49d50573193bd64f840e..124b357e35a5643eb47d28b7a0d220c3aa66da03 100644 (file)
@@ -1,7 +1,6 @@
 #include <linux/version.h>
-#ifdef HAVE_EXPORT_H
-#include <linux/export.h>
-#endif
+#define IP_SET_COMPAT_HEADERS
+#include <linux/netfilter/ipset/ip_set_compat.h>
 #include <linux/netfilter/ipset/pfxlen.h>
 
 /* Prefixlen maps for fast conversions, by Jan Engelhardt. */