From 05b0bd667b8f66ec93761ef4b91d78ff1963b039 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Mon, 3 Nov 2014 08:06:19 +0100 Subject: Use IS_ENABLED macro and define it if required --- kernel/include/linux/netfilter/ipset/ip_set_compat.h.in | 11 +++++++++++ kernel/net/netfilter/ipset/ip_set_getport.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) 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 85684f3..0966289 100644 --- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in +++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in @@ -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 diff --git a/kernel/net/netfilter/ipset/ip_set_getport.c b/kernel/net/netfilter/ipset/ip_set_getport.c index 5d5ff82..52cdce6 100644 --- a/kernel/net/netfilter/ipset/ip_set_getport.c +++ b/kernel/net/netfilter/ipset/ip_set_getport.c @@ -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) -- cgit v1.2.3