|
@@ -21,7 +21,7 @@
|
|
|
#include <linux/mm.h>
|
|
|
#include <linux/in.h>
|
|
|
#include <linux/ip.h>
|
|
|
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
|
|
|
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
|
|
|
#include <linux/ipv6.h>
|
|
|
#include <net/ipv6.h>
|
|
|
#endif
|
|
@@ -64,7 +64,7 @@ struct dsthash_dst {
|
|
|
__be32 src;
|
|
|
__be32 dst;
|
|
|
} ip;
|
|
|
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
|
|
|
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
|
|
|
struct {
|
|
|
__be32 src[4];
|
|
|
__be32 dst[4];
|
|
@@ -413,7 +413,7 @@ static inline __be32 maskl(__be32 a, unsigned int l)
|
|
|
return l ? htonl(ntohl(a) & ~0 << (32 - l)) : 0;
|
|
|
}
|
|
|
|
|
|
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
|
|
|
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
|
|
|
static void hashlimit_ipv6_mask(__be32 *i, unsigned int p)
|
|
|
{
|
|
|
switch (p) {
|
|
@@ -464,7 +464,7 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo,
|
|
|
return 0;
|
|
|
nexthdr = ip_hdr(skb)->protocol;
|
|
|
break;
|
|
|
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
|
|
|
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
|
|
|
case NFPROTO_IPV6:
|
|
|
if (hinfo->cfg.mode & XT_HASHLIMIT_HASH_DIP) {
|
|
|
memcpy(&dst->ip6.dst, &ipv6_hdr(skb)->daddr,
|
|
@@ -616,7 +616,7 @@ static struct xt_match hashlimit_mt_reg[] __read_mostly = {
|
|
|
.destroy = hashlimit_mt_destroy,
|
|
|
.me = THIS_MODULE,
|
|
|
},
|
|
|
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
|
|
|
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
|
|
|
{
|
|
|
.name = "hashlimit",
|
|
|
.revision = 1,
|
|
@@ -693,7 +693,7 @@ static int dl_seq_real_show(struct dsthash_ent *ent, u_int8_t family,
|
|
|
ent->rateinfo.credit, ent->rateinfo.credit_cap,
|
|
|
ent->rateinfo.cost);
|
|
|
break;
|
|
|
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
|
|
|
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
|
|
|
case NFPROTO_IPV6:
|
|
|
res = seq_printf(s, "%ld %pI6:%u->%pI6:%u %u %u %u\n",
|
|
|
(long)(ent->expires - jiffies)/HZ,
|
|
@@ -761,7 +761,7 @@ static int __net_init hashlimit_proc_net_init(struct net *net)
|
|
|
hashlimit_net->ipt_hashlimit = proc_mkdir("ipt_hashlimit", net->proc_net);
|
|
|
if (!hashlimit_net->ipt_hashlimit)
|
|
|
return -ENOMEM;
|
|
|
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
|
|
|
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
|
|
|
hashlimit_net->ip6t_hashlimit = proc_mkdir("ip6t_hashlimit", net->proc_net);
|
|
|
if (!hashlimit_net->ip6t_hashlimit) {
|
|
|
proc_net_remove(net, "ipt_hashlimit");
|
|
@@ -774,7 +774,7 @@ static int __net_init hashlimit_proc_net_init(struct net *net)
|
|
|
static void __net_exit hashlimit_proc_net_exit(struct net *net)
|
|
|
{
|
|
|
proc_net_remove(net, "ipt_hashlimit");
|
|
|
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
|
|
|
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
|
|
|
proc_net_remove(net, "ip6t_hashlimit");
|
|
|
#endif
|
|
|
}
|