Skip to content

Commit c0cd115

Browse files
Igor Maravićdavem330
authored andcommitted
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>
1 parent 29c3626 commit c0cd115

19 files changed

Lines changed: 45 additions & 46 deletions

‎net/netfilter/core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ int skb_make_writable(struct sk_buff *skb, unsigned int writable_len)
229229
}
230230
EXPORT_SYMBOL(skb_make_writable);
231231

232-
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
232+
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
233233
/* This does not belong here, but locally generated errors need it if connection
234234
tracking in use: without this, connection may not be in hash table, and hence
235235
manufactured ICMP or RST packets will not be associated with it. */

‎net/netfilter/ipset/ip_set_getport.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ ip_set_get_ip4_port(const struct sk_buff *skb, bool src,
109109
}
110110
EXPORT_SYMBOL_GPL(ip_set_get_ip4_port);
111111

112-
#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
112+
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
113113
bool
114114
ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
115115
__be16 *port, u8 *proto)

‎net/netfilter/ipvs/ip_vs_xmit.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
541541
* Avoid duplicate tuple in reply direction for NAT traffic
542542
* to local address when connection is sync-ed
543543
*/
544-
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
544+
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
545545
if (cp->flags & IP_VS_CONN_F_SYNC && local) {
546546
enum ip_conntrack_info ctinfo;
547547
struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo);
@@ -658,7 +658,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
658658
* Avoid duplicate tuple in reply direction for NAT traffic
659659
* to local address when connection is sync-ed
660660
*/
661-
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
661+
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
662662
if (cp->flags & IP_VS_CONN_F_SYNC && local) {
663663
enum ip_conntrack_info ctinfo;
664664
struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo);
@@ -1173,7 +1173,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
11731173
* Avoid duplicate tuple in reply direction for NAT traffic
11741174
* to local address when connection is sync-ed
11751175
*/
1176-
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
1176+
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
11771177
if (cp->flags & IP_VS_CONN_F_SYNC && local) {
11781178
enum ip_conntrack_info ctinfo;
11791179
struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo);
@@ -1293,7 +1293,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
12931293
* Avoid duplicate tuple in reply direction for NAT traffic
12941294
* to local address when connection is sync-ed
12951295
*/
1296-
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
1296+
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
12971297
if (cp->flags & IP_VS_CONN_F_SYNC && local) {
12981298
enum ip_conntrack_info ctinfo;
12991299
struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo);

‎net/netfilter/nf_conntrack_core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ static struct nf_ct_ext_type nf_ct_zone_extend __read_mostly = {
10871087
};
10881088
#endif
10891089

1090-
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
1090+
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
10911091

10921092
#include <linux/netfilter/nfnetlink.h>
10931093
#include <linux/netfilter/nfnetlink_conntrack.h>

‎net/netfilter/nf_conntrack_h323_main.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,7 @@ static int callforward_do_filter(const union nf_inet_addr *src,
743743
}
744744
break;
745745
}
746-
#if defined(CONFIG_NF_CONNTRACK_IPV6) || \
747-
defined(CONFIG_NF_CONNTRACK_IPV6_MODULE)
746+
#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6)
748747
case AF_INET6: {
749748
struct flowi6 fl1, fl2;
750749
struct rt6_info *rt1, *rt2;

‎net/netfilter/nf_conntrack_proto_dccp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ static int dccp_print_conntrack(struct seq_file *s, struct nf_conn *ct)
629629
return seq_printf(s, "%s ", dccp_state_names[ct->proto.dccp.state]);
630630
}
631631

632-
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
632+
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
633633
static int dccp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,
634634
struct nf_conn *ct)
635635
{
@@ -770,7 +770,7 @@ static struct nf_conntrack_l4proto dccp_proto4 __read_mostly = {
770770
.error = dccp_error,
771771
.print_tuple = dccp_print_tuple,
772772
.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)
774774
.to_nlattr = dccp_to_nlattr,
775775
.nlattr_size = dccp_nlattr_size,
776776
.from_nlattr = nlattr_to_dccp,
@@ -792,7 +792,7 @@ static struct nf_conntrack_l4proto dccp_proto6 __read_mostly = {
792792
.error = dccp_error,
793793
.print_tuple = dccp_print_tuple,
794794
.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)
796796
.to_nlattr = dccp_to_nlattr,
797797
.nlattr_size = dccp_nlattr_size,
798798
.from_nlattr = nlattr_to_dccp,

‎net/netfilter/nf_conntrack_proto_gre.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_gre4 __read_mostly = {
291291
.new = gre_new,
292292
.destroy = gre_destroy,
293293
.me = THIS_MODULE,
294-
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
294+
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
295295
.tuple_to_nlattr = nf_ct_port_tuple_to_nlattr,
296296
.nlattr_tuple_size = nf_ct_port_nlattr_tuple_size,
297297
.nlattr_to_tuple = nf_ct_port_nlattr_to_tuple,

‎net/netfilter/nf_conntrack_proto_sctp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ static bool sctp_new(struct nf_conn *ct, const struct sk_buff *skb,
461461
return true;
462462
}
463463

464-
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
464+
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
465465

466466
#include <linux/netfilter/nfnetlink.h>
467467
#include <linux/netfilter/nfnetlink_conntrack.h>
@@ -666,7 +666,7 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp4 __read_mostly = {
666666
.packet = sctp_packet,
667667
.new = sctp_new,
668668
.me = THIS_MODULE,
669-
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
669+
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
670670
.to_nlattr = sctp_to_nlattr,
671671
.nlattr_size = sctp_nlattr_size,
672672
.from_nlattr = nlattr_to_sctp,
@@ -696,7 +696,7 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp6 __read_mostly = {
696696
.packet = sctp_packet,
697697
.new = sctp_new,
698698
.me = THIS_MODULE,
699-
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
699+
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
700700
.to_nlattr = sctp_to_nlattr,
701701
.nlattr_size = sctp_nlattr_size,
702702
.from_nlattr = nlattr_to_sctp,

‎net/netfilter/nf_conntrack_proto_tcp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ static bool tcp_new(struct nf_conn *ct, const struct sk_buff *skb,
11261126
return true;
11271127
}
11281128

1129-
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
1129+
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
11301130

11311131
#include <linux/netfilter/nfnetlink.h>
11321132
#include <linux/netfilter/nfnetlink_conntrack.h>
@@ -1447,7 +1447,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4 __read_mostly =
14471447
.packet = tcp_packet,
14481448
.new = tcp_new,
14491449
.error = tcp_error,
1450-
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
1450+
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
14511451
.to_nlattr = tcp_to_nlattr,
14521452
.nlattr_size = tcp_nlattr_size,
14531453
.from_nlattr = nlattr_to_tcp,
@@ -1479,7 +1479,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6 __read_mostly =
14791479
.packet = tcp_packet,
14801480
.new = tcp_new,
14811481
.error = tcp_error,
1482-
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
1482+
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
14831483
.to_nlattr = tcp_to_nlattr,
14841484
.nlattr_size = tcp_nlattr_size,
14851485
.from_nlattr = nlattr_to_tcp,

‎net/netfilter/nf_conntrack_proto_udp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4 __read_mostly =
188188
.packet = udp_packet,
189189
.new = udp_new,
190190
.error = udp_error,
191-
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
191+
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
192192
.tuple_to_nlattr = nf_ct_port_tuple_to_nlattr,
193193
.nlattr_to_tuple = nf_ct_port_nlattr_to_tuple,
194194
.nlattr_tuple_size = nf_ct_port_nlattr_tuple_size,
@@ -216,7 +216,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6 __read_mostly =
216216
.packet = udp_packet,
217217
.new = udp_new,
218218
.error = udp_error,
219-
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
219+
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
220220
.tuple_to_nlattr = nf_ct_port_tuple_to_nlattr,
221221
.nlattr_to_tuple = nf_ct_port_nlattr_to_tuple,
222222
.nlattr_tuple_size = nf_ct_port_nlattr_tuple_size,

0 commit comments

Comments
 (0)