Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net:netfilter: use IS_ENABLED

Use IS_ENABLED(CONFIG_FOO)
instead of defined(CONFIG_FOO) || defined (CONFIG_FOO_MODULE)

Signed-off-by: Igor Maravić <igorm@etf.rs>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Igor Maravić and committed by
David S. Miller
c0cd1156 29c36262

+45 -46
+1 -1
net/netfilter/core.c
··· 229 229 } 230 230 EXPORT_SYMBOL(skb_make_writable); 231 231 232 - #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 232 + #if IS_ENABLED(CONFIG_NF_CONNTRACK) 233 233 /* This does not belong here, but locally generated errors need it if connection 234 234 tracking in use: without this, connection may not be in hash table, and hence 235 235 manufactured ICMP or RST packets will not be associated with it. */
+1 -1
net/netfilter/ipset/ip_set_getport.c
··· 109 109 } 110 110 EXPORT_SYMBOL_GPL(ip_set_get_ip4_port); 111 111 112 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 112 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 113 113 bool 114 114 ip_set_get_ip6_port(const struct sk_buff *skb, bool src, 115 115 __be16 *port, u8 *proto)
+4 -4
net/netfilter/ipvs/ip_vs_xmit.c
··· 541 541 * Avoid duplicate tuple in reply direction for NAT traffic 542 542 * to local address when connection is sync-ed 543 543 */ 544 - #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 544 + #if IS_ENABLED(CONFIG_NF_CONNTRACK) 545 545 if (cp->flags & IP_VS_CONN_F_SYNC && local) { 546 546 enum ip_conntrack_info ctinfo; 547 547 struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo); ··· 658 658 * Avoid duplicate tuple in reply direction for NAT traffic 659 659 * to local address when connection is sync-ed 660 660 */ 661 - #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 661 + #if IS_ENABLED(CONFIG_NF_CONNTRACK) 662 662 if (cp->flags & IP_VS_CONN_F_SYNC && local) { 663 663 enum ip_conntrack_info ctinfo; 664 664 struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo); ··· 1173 1173 * Avoid duplicate tuple in reply direction for NAT traffic 1174 1174 * to local address when connection is sync-ed 1175 1175 */ 1176 - #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 1176 + #if IS_ENABLED(CONFIG_NF_CONNTRACK) 1177 1177 if (cp->flags & IP_VS_CONN_F_SYNC && local) { 1178 1178 enum ip_conntrack_info ctinfo; 1179 1179 struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo); ··· 1293 1293 * Avoid duplicate tuple in reply direction for NAT traffic 1294 1294 * to local address when connection is sync-ed 1295 1295 */ 1296 - #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 1296 + #if IS_ENABLED(CONFIG_NF_CONNTRACK) 1297 1297 if (cp->flags & IP_VS_CONN_F_SYNC && local) { 1298 1298 enum ip_conntrack_info ctinfo; 1299 1299 struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo);
+1 -1
net/netfilter/nf_conntrack_core.c
··· 1087 1087 }; 1088 1088 #endif 1089 1089 1090 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 1090 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 1091 1091 1092 1092 #include <linux/netfilter/nfnetlink.h> 1093 1093 #include <linux/netfilter/nfnetlink_conntrack.h>
+1 -2
net/netfilter/nf_conntrack_h323_main.c
··· 743 743 } 744 744 break; 745 745 } 746 - #if defined(CONFIG_NF_CONNTRACK_IPV6) || \ 747 - defined(CONFIG_NF_CONNTRACK_IPV6_MODULE) 746 + #if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) 748 747 case AF_INET6: { 749 748 struct flowi6 fl1, fl2; 750 749 struct rt6_info *rt1, *rt2;
+3 -3
net/netfilter/nf_conntrack_proto_dccp.c
··· 629 629 return seq_printf(s, "%s ", dccp_state_names[ct->proto.dccp.state]); 630 630 } 631 631 632 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 632 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 633 633 static int dccp_to_nlattr(struct sk_buff *skb, struct nlattr *nla, 634 634 struct nf_conn *ct) 635 635 { ··· 770 770 .error = dccp_error, 771 771 .print_tuple = dccp_print_tuple, 772 772 .print_conntrack = dccp_print_conntrack, 773 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 773 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 774 774 .to_nlattr = dccp_to_nlattr, 775 775 .nlattr_size = dccp_nlattr_size, 776 776 .from_nlattr = nlattr_to_dccp, ··· 792 792 .error = dccp_error, 793 793 .print_tuple = dccp_print_tuple, 794 794 .print_conntrack = dccp_print_conntrack, 795 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 795 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 796 796 .to_nlattr = dccp_to_nlattr, 797 797 .nlattr_size = dccp_nlattr_size, 798 798 .from_nlattr = nlattr_to_dccp,
+1 -1
net/netfilter/nf_conntrack_proto_gre.c
··· 291 291 .new = gre_new, 292 292 .destroy = gre_destroy, 293 293 .me = THIS_MODULE, 294 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 294 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 295 295 .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, 296 296 .nlattr_tuple_size = nf_ct_port_nlattr_tuple_size, 297 297 .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple,
+3 -3
net/netfilter/nf_conntrack_proto_sctp.c
··· 461 461 return true; 462 462 } 463 463 464 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 464 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 465 465 466 466 #include <linux/netfilter/nfnetlink.h> 467 467 #include <linux/netfilter/nfnetlink_conntrack.h> ··· 666 666 .packet = sctp_packet, 667 667 .new = sctp_new, 668 668 .me = THIS_MODULE, 669 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 669 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 670 670 .to_nlattr = sctp_to_nlattr, 671 671 .nlattr_size = sctp_nlattr_size, 672 672 .from_nlattr = nlattr_to_sctp, ··· 696 696 .packet = sctp_packet, 697 697 .new = sctp_new, 698 698 .me = THIS_MODULE, 699 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 699 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 700 700 .to_nlattr = sctp_to_nlattr, 701 701 .nlattr_size = sctp_nlattr_size, 702 702 .from_nlattr = nlattr_to_sctp,
+3 -3
net/netfilter/nf_conntrack_proto_tcp.c
··· 1126 1126 return true; 1127 1127 } 1128 1128 1129 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 1129 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 1130 1130 1131 1131 #include <linux/netfilter/nfnetlink.h> 1132 1132 #include <linux/netfilter/nfnetlink_conntrack.h> ··· 1447 1447 .packet = tcp_packet, 1448 1448 .new = tcp_new, 1449 1449 .error = tcp_error, 1450 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 1450 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 1451 1451 .to_nlattr = tcp_to_nlattr, 1452 1452 .nlattr_size = tcp_nlattr_size, 1453 1453 .from_nlattr = nlattr_to_tcp, ··· 1479 1479 .packet = tcp_packet, 1480 1480 .new = tcp_new, 1481 1481 .error = tcp_error, 1482 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 1482 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 1483 1483 .to_nlattr = tcp_to_nlattr, 1484 1484 .nlattr_size = tcp_nlattr_size, 1485 1485 .from_nlattr = nlattr_to_tcp,
+2 -2
net/netfilter/nf_conntrack_proto_udp.c
··· 188 188 .packet = udp_packet, 189 189 .new = udp_new, 190 190 .error = udp_error, 191 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 191 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 192 192 .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, 193 193 .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple, 194 194 .nlattr_tuple_size = nf_ct_port_nlattr_tuple_size, ··· 216 216 .packet = udp_packet, 217 217 .new = udp_new, 218 218 .error = udp_error, 219 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 219 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 220 220 .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, 221 221 .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple, 222 222 .nlattr_tuple_size = nf_ct_port_nlattr_tuple_size,
+2 -2
net/netfilter/nf_conntrack_proto_udplite.c
··· 174 174 .packet = udplite_packet, 175 175 .new = udplite_new, 176 176 .error = udplite_error, 177 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 177 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 178 178 .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, 179 179 .nlattr_tuple_size = nf_ct_port_nlattr_tuple_size, 180 180 .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple, ··· 198 198 .packet = udplite_packet, 199 199 .new = udplite_new, 200 200 .error = udplite_error, 201 - #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE) 201 + #if IS_ENABLED(CONFIG_NF_CT_NETLINK) 202 202 .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, 203 203 .nlattr_tuple_size = nf_ct_port_nlattr_tuple_size, 204 204 .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple,
+2 -2
net/netfilter/xt_NFQUEUE.c
··· 49 49 return jhash_2words((__force u32)ipaddr, iph->protocol, jhash_initval); 50 50 } 51 51 52 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 52 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 53 53 static u32 hash_v6(const struct sk_buff *skb) 54 54 { 55 55 const struct ipv6hdr *ip6h = ipv6_hdr(skb); ··· 74 74 if (par->family == NFPROTO_IPV4) 75 75 queue = (((u64) hash_v4(skb) * info->queues_total) >> 76 76 32) + queue; 77 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 77 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 78 78 else if (par->family == NFPROTO_IPV6) 79 79 queue = (((u64) hash_v6(skb) * info->queues_total) >> 80 80 32) + queue;
+3 -3
net/netfilter/xt_TCPMSS.c
··· 198 198 return XT_CONTINUE; 199 199 } 200 200 201 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 201 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 202 202 static unsigned int 203 203 tcpmss_tg6(struct sk_buff *skb, const struct xt_action_param *par) 204 204 { ··· 260 260 return -EINVAL; 261 261 } 262 262 263 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 263 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 264 264 static int tcpmss_tg6_check(const struct xt_tgchk_param *par) 265 265 { 266 266 const struct xt_tcpmss_info *info = par->targinfo; ··· 293 293 .proto = IPPROTO_TCP, 294 294 .me = THIS_MODULE, 295 295 }, 296 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 296 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 297 297 { 298 298 .family = NFPROTO_IPV6, 299 299 .name = "TCPMSS",
+2 -2
net/netfilter/xt_TCPOPTSTRIP.c
··· 80 80 sizeof(struct iphdr) + sizeof(struct tcphdr)); 81 81 } 82 82 83 - #if defined(CONFIG_IP6_NF_MANGLE) || defined(CONFIG_IP6_NF_MANGLE_MODULE) 83 + #if IS_ENABLED(CONFIG_IP6_NF_MANGLE) 84 84 static unsigned int 85 85 tcpoptstrip_tg6(struct sk_buff *skb, const struct xt_action_param *par) 86 86 { ··· 109 109 .targetsize = sizeof(struct xt_tcpoptstrip_target_info), 110 110 .me = THIS_MODULE, 111 111 }, 112 - #if defined(CONFIG_IP6_NF_MANGLE) || defined(CONFIG_IP6_NF_MANGLE_MODULE) 112 + #if IS_ENABLED(CONFIG_IP6_NF_MANGLE) 113 113 { 114 114 .name = "TCPOPTSTRIP", 115 115 .family = NFPROTO_IPV6,
+1 -1
net/netfilter/xt_TEE.c
··· 25 25 #include <linux/netfilter/x_tables.h> 26 26 #include <linux/netfilter/xt_TEE.h> 27 27 28 - #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 28 + #if IS_ENABLED(CONFIG_NF_CONNTRACK) 29 29 # define WITH_CONNTRACK 1 30 30 # include <net/netfilter/nf_conntrack.h> 31 31 #endif
+1 -1
net/netfilter/xt_TPROXY.c
··· 22 22 23 23 #include <net/netfilter/ipv4/nf_defrag_ipv4.h> 24 24 25 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 25 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 26 26 #define XT_TPROXY_HAVE_IPV6 1 27 27 #include <net/if_inet6.h> 28 28 #include <net/addrconf.h>
+4 -4
net/netfilter/xt_addrtype.c
··· 16 16 #include <linux/ip.h> 17 17 #include <net/route.h> 18 18 19 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 19 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 20 20 #include <net/ipv6.h> 21 21 #include <net/ip6_route.h> 22 22 #include <net/ip6_fib.h> ··· 31 31 MODULE_ALIAS("ipt_addrtype"); 32 32 MODULE_ALIAS("ip6t_addrtype"); 33 33 34 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 34 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 35 35 static u32 match_lookup_rt6(struct net *net, const struct net_device *dev, 36 36 const struct in6_addr *addr) 37 37 { ··· 149 149 else if (info->flags & XT_ADDRTYPE_LIMIT_IFACE_OUT) 150 150 dev = par->out; 151 151 152 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 152 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 153 153 if (par->family == NFPROTO_IPV6) 154 154 return addrtype_mt6(net, dev, skb, info); 155 155 #endif ··· 190 190 return -EINVAL; 191 191 } 192 192 193 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 193 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 194 194 if (par->family == NFPROTO_IPV6) { 195 195 if ((info->source | info->dest) & XT_ADDRTYPE_BLACKHOLE) { 196 196 pr_err("ipv6 BLACKHOLE matching not supported\n");
+8 -8
net/netfilter/xt_hashlimit.c
··· 21 21 #include <linux/mm.h> 22 22 #include <linux/in.h> 23 23 #include <linux/ip.h> 24 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 24 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 25 25 #include <linux/ipv6.h> 26 26 #include <net/ipv6.h> 27 27 #endif ··· 64 64 __be32 src; 65 65 __be32 dst; 66 66 } ip; 67 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 67 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 68 68 struct { 69 69 __be32 src[4]; 70 70 __be32 dst[4]; ··· 413 413 return l ? htonl(ntohl(a) & ~0 << (32 - l)) : 0; 414 414 } 415 415 416 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 416 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 417 417 static void hashlimit_ipv6_mask(__be32 *i, unsigned int p) 418 418 { 419 419 switch (p) { ··· 464 464 return 0; 465 465 nexthdr = ip_hdr(skb)->protocol; 466 466 break; 467 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 467 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 468 468 case NFPROTO_IPV6: 469 469 if (hinfo->cfg.mode & XT_HASHLIMIT_HASH_DIP) { 470 470 memcpy(&dst->ip6.dst, &ipv6_hdr(skb)->daddr, ··· 616 616 .destroy = hashlimit_mt_destroy, 617 617 .me = THIS_MODULE, 618 618 }, 619 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 619 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 620 620 { 621 621 .name = "hashlimit", 622 622 .revision = 1, ··· 693 693 ent->rateinfo.credit, ent->rateinfo.credit_cap, 694 694 ent->rateinfo.cost); 695 695 break; 696 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 696 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 697 697 case NFPROTO_IPV6: 698 698 res = seq_printf(s, "%ld %pI6:%u->%pI6:%u %u %u %u\n", 699 699 (long)(ent->expires - jiffies)/HZ, ··· 761 761 hashlimit_net->ipt_hashlimit = proc_mkdir("ipt_hashlimit", net->proc_net); 762 762 if (!hashlimit_net->ipt_hashlimit) 763 763 return -ENOMEM; 764 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 764 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 765 765 hashlimit_net->ip6t_hashlimit = proc_mkdir("ip6t_hashlimit", net->proc_net); 766 766 if (!hashlimit_net->ip6t_hashlimit) { 767 767 proc_net_remove(net, "ipt_hashlimit"); ··· 774 774 static void __net_exit hashlimit_proc_net_exit(struct net *net) 775 775 { 776 776 proc_net_remove(net, "ipt_hashlimit"); 777 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 777 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 778 778 proc_net_remove(net, "ip6t_hashlimit"); 779 779 #endif 780 780 }
+2 -2
net/netfilter/xt_socket.c
··· 22 22 #include <net/netfilter/nf_tproxy_core.h> 23 23 #include <net/netfilter/ipv4/nf_defrag_ipv4.h> 24 24 25 - #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 25 + #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 26 26 #define XT_SOCKET_HAVE_IPV6 1 27 27 #include <linux/netfilter_ipv6/ip6_tables.h> 28 28 #include <net/netfilter/ipv6/nf_defrag_ipv6.h> ··· 30 30 31 31 #include <linux/netfilter/xt_socket.h> 32 32 33 - #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 33 + #if IS_ENABLED(CONFIG_NF_CONNTRACK) 34 34 #define XT_SOCKET_HAVE_CONNTRACK 1 35 35 #include <net/netfilter/nf_conntrack.h> 36 36 #endif