diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2014-11-03 08:06:19 +0100 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2014-11-03 08:06:19 +0100 |
commit | 05b0bd667b8f66ec93761ef4b91d78ff1963b039 (patch) | |
tree | 1d3c1519543408adb4bbd59c6c4b6508914ea928 /kernel | |
parent | 2cff85e32c975667d44a521a3841a2c68088d46d (diff) |
Use IS_ENABLED macro and define it if required
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/include/linux/netfilter/ipset/ip_set_compat.h.in | 11 | ||||
-rw-r--r-- | kernel/net/netfilter/ipset/ip_set_getport.c | 2 |
2 files changed, 12 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 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) |