]> granicus.if.org Git - ipset/commitdiff
Use IS_ENABLED macro and define it if required
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Mon, 3 Nov 2014 07:06:19 +0000 (08:06 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Mon, 3 Nov 2014 07:06:19 +0000 (08:06 +0100)
kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
kernel/net/netfilter/ipset/ip_set_getport.c

index 85684f334a76b3fb539a45cd5bd04dddc6447173..0966289f41afa47c16fb0043cc1666331cddd1f5 100644 (file)
@@ -9,6 +9,17 @@
 #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
+
 #@HAVE_STRUCT_XT_ACTION_PARAM@ HAVE_STRUCT_XT_ACTION_PARAM
 #@HAVE_VZALLOC@ HAVE_VZALLOC
 #@HAVE_ETHER_ADDR_EQUAL@ HAVE_ETHER_ADDR_EQUAL
index 5d5ff8228bc0a5c6c0d0086457658249248493fd..52cdce6e7e62a15a448fdf8aac09be3405d70161 100644 (file)
@@ -129,7 +129,7 @@ ip_set_get_ip4_port(const struct sk_buff *skb, bool src,
 }
 EXPORT_SYMBOL_GPL(ip_set_get_ip4_port);
 
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
 bool
 ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
                    __be16 *port, u8 *proto)