diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-10-01 05:19:17 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-10-02 12:30:54 -0400 |
commit | 1109a90c01177e8f4a5fd95c5b685ad02f1fe9bb (patch) | |
tree | 2712547647a21ae3e56e2cb42dd2c84087ed640f | |
parent | c8d7b98bec43faaa6583c3135030be5eb4693acb (diff) |
netfilter: use IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
In 34666d4 ("netfilter: bridge: move br_netfilter out of the core"),
the bridge netfilter code has been modularized.
Use IS_ENABLED instead of ifdef to cover the module case.
Fixes: 34666d4 ("netfilter: bridge: move br_netfilter out of the core")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/core/skbuff.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_REJECT.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_defrag_ipv4.c | 2 | ||||
-rw-r--r-- | net/ipv6/netfilter/nf_defrag_ipv6_hooks.c | 2 | ||||
-rw-r--r-- | net/netfilter/ipset/ip_set_hash_netiface.c | 4 | ||||
-rw-r--r-- | net/netfilter/nf_log_common.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_queue.c | 4 | ||||
-rw-r--r-- | net/netfilter/nfnetlink_log.c | 8 | ||||
-rw-r--r-- | net/netfilter/nfnetlink_queue_core.c | 12 |
10 files changed, 20 insertions, 20 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 4be570a4ab21..7de3d679f3e0 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -566,7 +566,7 @@ static void skb_release_head_state(struct sk_buff *skb) | |||
566 | #if IS_ENABLED(CONFIG_NF_CONNTRACK) | 566 | #if IS_ENABLED(CONFIG_NF_CONNTRACK) |
567 | nf_conntrack_put(skb->nfct); | 567 | nf_conntrack_put(skb->nfct); |
568 | #endif | 568 | #endif |
569 | #ifdef CONFIG_BRIDGE_NETFILTER | 569 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
570 | nf_bridge_put(skb->nf_bridge); | 570 | nf_bridge_put(skb->nf_bridge); |
571 | #endif | 571 | #endif |
572 | /* XXX: IS this still necessary? - JHS */ | 572 | /* XXX: IS this still necessary? - JHS */ |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index c8fa62476461..e35b71289156 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -516,7 +516,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
516 | 516 | ||
517 | hlen = iph->ihl * 4; | 517 | hlen = iph->ihl * 4; |
518 | mtu = mtu - hlen; /* Size of data space */ | 518 | mtu = mtu - hlen; /* Size of data space */ |
519 | #ifdef CONFIG_BRIDGE_NETFILTER | 519 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
520 | if (skb->nf_bridge) | 520 | if (skb->nf_bridge) |
521 | mtu -= nf_bridge_mtu_reduction(skb); | 521 | mtu -= nf_bridge_mtu_reduction(skb); |
522 | #endif | 522 | #endif |
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c index 5b6e0df4ccff..8f48f5517e33 100644 --- a/net/ipv4/netfilter/ipt_REJECT.c +++ b/net/ipv4/netfilter/ipt_REJECT.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/netfilter/x_tables.h> | 20 | #include <linux/netfilter/x_tables.h> |
21 | #include <linux/netfilter_ipv4/ip_tables.h> | 21 | #include <linux/netfilter_ipv4/ip_tables.h> |
22 | #include <linux/netfilter_ipv4/ipt_REJECT.h> | 22 | #include <linux/netfilter_ipv4/ipt_REJECT.h> |
23 | #ifdef CONFIG_BRIDGE_NETFILTER | 23 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
24 | #include <linux/netfilter_bridge.h> | 24 | #include <linux/netfilter_bridge.h> |
25 | #endif | 25 | #endif |
26 | 26 | ||
diff --git a/net/ipv4/netfilter/nf_defrag_ipv4.c b/net/ipv4/netfilter/nf_defrag_ipv4.c index 76bd1aef257f..7e5ca6f2d0cd 100644 --- a/net/ipv4/netfilter/nf_defrag_ipv4.c +++ b/net/ipv4/netfilter/nf_defrag_ipv4.c | |||
@@ -50,7 +50,7 @@ static enum ip_defrag_users nf_ct_defrag_user(unsigned int hooknum, | |||
50 | zone = nf_ct_zone((struct nf_conn *)skb->nfct); | 50 | zone = nf_ct_zone((struct nf_conn *)skb->nfct); |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | #ifdef CONFIG_BRIDGE_NETFILTER | 53 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
54 | if (skb->nf_bridge && | 54 | if (skb->nf_bridge && |
55 | skb->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING) | 55 | skb->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING) |
56 | return IP_DEFRAG_CONNTRACK_BRIDGE_IN + zone; | 56 | return IP_DEFRAG_CONNTRACK_BRIDGE_IN + zone; |
diff --git a/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c b/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c index 7b9a748c6bac..e70382e4dfb5 100644 --- a/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c +++ b/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c | |||
@@ -40,7 +40,7 @@ static enum ip6_defrag_users nf_ct6_defrag_user(unsigned int hooknum, | |||
40 | zone = nf_ct_zone((struct nf_conn *)skb->nfct); | 40 | zone = nf_ct_zone((struct nf_conn *)skb->nfct); |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #ifdef CONFIG_BRIDGE_NETFILTER | 43 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
44 | if (skb->nf_bridge && | 44 | if (skb->nf_bridge && |
45 | skb->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING) | 45 | skb->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING) |
46 | return IP6_DEFRAG_CONNTRACK_BRIDGE_IN + zone; | 46 | return IP6_DEFRAG_CONNTRACK_BRIDGE_IN + zone; |
diff --git a/net/netfilter/ipset/ip_set_hash_netiface.c b/net/netfilter/ipset/ip_set_hash_netiface.c index 03cdb69ac9bf..35dd35873442 100644 --- a/net/netfilter/ipset/ip_set_hash_netiface.c +++ b/net/netfilter/ipset/ip_set_hash_netiface.c | |||
@@ -237,7 +237,7 @@ hash_netiface4_kadt(struct ip_set *set, const struct sk_buff *skb, | |||
237 | #define SRCDIR (opt->flags & IPSET_DIM_TWO_SRC) | 237 | #define SRCDIR (opt->flags & IPSET_DIM_TWO_SRC) |
238 | 238 | ||
239 | if (opt->cmdflags & IPSET_FLAG_PHYSDEV) { | 239 | if (opt->cmdflags & IPSET_FLAG_PHYSDEV) { |
240 | #ifdef CONFIG_BRIDGE_NETFILTER | 240 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
241 | const struct nf_bridge_info *nf_bridge = skb->nf_bridge; | 241 | const struct nf_bridge_info *nf_bridge = skb->nf_bridge; |
242 | 242 | ||
243 | if (!nf_bridge) | 243 | if (!nf_bridge) |
@@ -474,7 +474,7 @@ hash_netiface6_kadt(struct ip_set *set, const struct sk_buff *skb, | |||
474 | ip6_netmask(&e.ip, e.cidr); | 474 | ip6_netmask(&e.ip, e.cidr); |
475 | 475 | ||
476 | if (opt->cmdflags & IPSET_FLAG_PHYSDEV) { | 476 | if (opt->cmdflags & IPSET_FLAG_PHYSDEV) { |
477 | #ifdef CONFIG_BRIDGE_NETFILTER | 477 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
478 | const struct nf_bridge_info *nf_bridge = skb->nf_bridge; | 478 | const struct nf_bridge_info *nf_bridge = skb->nf_bridge; |
479 | 479 | ||
480 | if (!nf_bridge) | 480 | if (!nf_bridge) |
diff --git a/net/netfilter/nf_log_common.c b/net/netfilter/nf_log_common.c index eeb8ef4ff1a3..a2233e77cf39 100644 --- a/net/netfilter/nf_log_common.c +++ b/net/netfilter/nf_log_common.c | |||
@@ -158,7 +158,7 @@ nf_log_dump_packet_common(struct nf_log_buf *m, u_int8_t pf, | |||
158 | '0' + loginfo->u.log.level, prefix, | 158 | '0' + loginfo->u.log.level, prefix, |
159 | in ? in->name : "", | 159 | in ? in->name : "", |
160 | out ? out->name : ""); | 160 | out ? out->name : ""); |
161 | #ifdef CONFIG_BRIDGE_NETFILTER | 161 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
162 | if (skb->nf_bridge) { | 162 | if (skb->nf_bridge) { |
163 | const struct net_device *physindev; | 163 | const struct net_device *physindev; |
164 | const struct net_device *physoutdev; | 164 | const struct net_device *physoutdev; |
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c index 5d24b1fdb593..4c8b68e5fa16 100644 --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c | |||
@@ -52,7 +52,7 @@ void nf_queue_entry_release_refs(struct nf_queue_entry *entry) | |||
52 | dev_put(entry->indev); | 52 | dev_put(entry->indev); |
53 | if (entry->outdev) | 53 | if (entry->outdev) |
54 | dev_put(entry->outdev); | 54 | dev_put(entry->outdev); |
55 | #ifdef CONFIG_BRIDGE_NETFILTER | 55 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
56 | if (entry->skb->nf_bridge) { | 56 | if (entry->skb->nf_bridge) { |
57 | struct nf_bridge_info *nf_bridge = entry->skb->nf_bridge; | 57 | struct nf_bridge_info *nf_bridge = entry->skb->nf_bridge; |
58 | 58 | ||
@@ -77,7 +77,7 @@ bool nf_queue_entry_get_refs(struct nf_queue_entry *entry) | |||
77 | dev_hold(entry->indev); | 77 | dev_hold(entry->indev); |
78 | if (entry->outdev) | 78 | if (entry->outdev) |
79 | dev_hold(entry->outdev); | 79 | dev_hold(entry->outdev); |
80 | #ifdef CONFIG_BRIDGE_NETFILTER | 80 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
81 | if (entry->skb->nf_bridge) { | 81 | if (entry->skb->nf_bridge) { |
82 | struct nf_bridge_info *nf_bridge = entry->skb->nf_bridge; | 82 | struct nf_bridge_info *nf_bridge = entry->skb->nf_bridge; |
83 | struct net_device *physdev; | 83 | struct net_device *physdev; |
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index a11c5ff2f720..b1e3a0579416 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -36,7 +36,7 @@ | |||
36 | 36 | ||
37 | #include <linux/atomic.h> | 37 | #include <linux/atomic.h> |
38 | 38 | ||
39 | #ifdef CONFIG_BRIDGE_NETFILTER | 39 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
40 | #include "../bridge/br_private.h" | 40 | #include "../bridge/br_private.h" |
41 | #endif | 41 | #endif |
42 | 42 | ||
@@ -429,7 +429,7 @@ __build_packet_message(struct nfnl_log_net *log, | |||
429 | goto nla_put_failure; | 429 | goto nla_put_failure; |
430 | 430 | ||
431 | if (indev) { | 431 | if (indev) { |
432 | #ifndef CONFIG_BRIDGE_NETFILTER | 432 | #if !IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
433 | if (nla_put_be32(inst->skb, NFULA_IFINDEX_INDEV, | 433 | if (nla_put_be32(inst->skb, NFULA_IFINDEX_INDEV, |
434 | htonl(indev->ifindex))) | 434 | htonl(indev->ifindex))) |
435 | goto nla_put_failure; | 435 | goto nla_put_failure; |
@@ -460,7 +460,7 @@ __build_packet_message(struct nfnl_log_net *log, | |||
460 | } | 460 | } |
461 | 461 | ||
462 | if (outdev) { | 462 | if (outdev) { |
463 | #ifndef CONFIG_BRIDGE_NETFILTER | 463 | #if !IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
464 | if (nla_put_be32(inst->skb, NFULA_IFINDEX_OUTDEV, | 464 | if (nla_put_be32(inst->skb, NFULA_IFINDEX_OUTDEV, |
465 | htonl(outdev->ifindex))) | 465 | htonl(outdev->ifindex))) |
466 | goto nla_put_failure; | 466 | goto nla_put_failure; |
@@ -640,7 +640,7 @@ nfulnl_log_packet(struct net *net, | |||
640 | + nla_total_size(sizeof(struct nfulnl_msg_packet_hdr)) | 640 | + nla_total_size(sizeof(struct nfulnl_msg_packet_hdr)) |
641 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ | 641 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ |
642 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ | 642 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ |
643 | #ifdef CONFIG_BRIDGE_NETFILTER | 643 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
644 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ | 644 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ |
645 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ | 645 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ |
646 | #endif | 646 | #endif |
diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c index 108120f216b1..a82077d9f59b 100644 --- a/net/netfilter/nfnetlink_queue_core.c +++ b/net/netfilter/nfnetlink_queue_core.c | |||
@@ -36,7 +36,7 @@ | |||
36 | 36 | ||
37 | #include <linux/atomic.h> | 37 | #include <linux/atomic.h> |
38 | 38 | ||
39 | #ifdef CONFIG_BRIDGE_NETFILTER | 39 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
40 | #include "../bridge/br_private.h" | 40 | #include "../bridge/br_private.h" |
41 | #endif | 41 | #endif |
42 | 42 | ||
@@ -302,7 +302,7 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue, | |||
302 | + nla_total_size(sizeof(struct nfqnl_msg_packet_hdr)) | 302 | + nla_total_size(sizeof(struct nfqnl_msg_packet_hdr)) |
303 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ | 303 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ |
304 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ | 304 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ |
305 | #ifdef CONFIG_BRIDGE_NETFILTER | 305 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
306 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ | 306 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ |
307 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ | 307 | + nla_total_size(sizeof(u_int32_t)) /* ifindex */ |
308 | #endif | 308 | #endif |
@@ -380,7 +380,7 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue, | |||
380 | 380 | ||
381 | indev = entry->indev; | 381 | indev = entry->indev; |
382 | if (indev) { | 382 | if (indev) { |
383 | #ifndef CONFIG_BRIDGE_NETFILTER | 383 | #if !IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
384 | if (nla_put_be32(skb, NFQA_IFINDEX_INDEV, htonl(indev->ifindex))) | 384 | if (nla_put_be32(skb, NFQA_IFINDEX_INDEV, htonl(indev->ifindex))) |
385 | goto nla_put_failure; | 385 | goto nla_put_failure; |
386 | #else | 386 | #else |
@@ -410,7 +410,7 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue, | |||
410 | } | 410 | } |
411 | 411 | ||
412 | if (outdev) { | 412 | if (outdev) { |
413 | #ifndef CONFIG_BRIDGE_NETFILTER | 413 | #if !IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
414 | if (nla_put_be32(skb, NFQA_IFINDEX_OUTDEV, htonl(outdev->ifindex))) | 414 | if (nla_put_be32(skb, NFQA_IFINDEX_OUTDEV, htonl(outdev->ifindex))) |
415 | goto nla_put_failure; | 415 | goto nla_put_failure; |
416 | #else | 416 | #else |
@@ -569,7 +569,7 @@ nf_queue_entry_dup(struct nf_queue_entry *e) | |||
569 | return NULL; | 569 | return NULL; |
570 | } | 570 | } |
571 | 571 | ||
572 | #ifdef CONFIG_BRIDGE_NETFILTER | 572 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
573 | /* When called from bridge netfilter, skb->data must point to MAC header | 573 | /* When called from bridge netfilter, skb->data must point to MAC header |
574 | * before calling skb_gso_segment(). Else, original MAC header is lost | 574 | * before calling skb_gso_segment(). Else, original MAC header is lost |
575 | * and segmented skbs will be sent to wrong destination. | 575 | * and segmented skbs will be sent to wrong destination. |
@@ -763,7 +763,7 @@ dev_cmp(struct nf_queue_entry *entry, unsigned long ifindex) | |||
763 | if (entry->outdev) | 763 | if (entry->outdev) |
764 | if (entry->outdev->ifindex == ifindex) | 764 | if (entry->outdev->ifindex == ifindex) |
765 | return 1; | 765 | return 1; |
766 | #ifdef CONFIG_BRIDGE_NETFILTER | 766 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
767 | if (entry->skb->nf_bridge) { | 767 | if (entry->skb->nf_bridge) { |
768 | if (entry->skb->nf_bridge->physindev && | 768 | if (entry->skb->nf_bridge->physindev && |
769 | entry->skb->nf_bridge->physindev->ifindex == ifindex) | 769 | entry->skb->nf_bridge->physindev->ifindex == ifindex) |