diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-12-10 04:48:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-11 18:25:16 -0500 |
commit | dfd56b8b38fff3586f36232db58e1e9f7885a605 (patch) | |
tree | 64c7142ebf4625939f68bd3603f1d37bacb20a73 /net/bridge | |
parent | 1ded132d4c3442aa3a619c94c245d7b5e0eb9731 (diff) |
net: use IS_ENABLED(CONFIG_IPV6)
Instead of testing defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_multicast.c | 32 | ||||
-rw-r--r-- | net/bridge/br_private.h | 2 |
2 files changed, 17 insertions, 17 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 375417e633c9..568d5bf17534 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/timer.h> | 25 | #include <linux/timer.h> |
26 | #include <net/ip.h> | 26 | #include <net/ip.h> |
27 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 27 | #if IS_ENABLED(CONFIG_IPV6) |
28 | #include <net/ipv6.h> | 28 | #include <net/ipv6.h> |
29 | #include <net/mld.h> | 29 | #include <net/mld.h> |
30 | #include <net/addrconf.h> | 30 | #include <net/addrconf.h> |
@@ -36,7 +36,7 @@ | |||
36 | #define mlock_dereference(X, br) \ | 36 | #define mlock_dereference(X, br) \ |
37 | rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) | 37 | rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) |
38 | 38 | ||
39 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 39 | #if IS_ENABLED(CONFIG_IPV6) |
40 | static inline int ipv6_is_transient_multicast(const struct in6_addr *addr) | 40 | static inline int ipv6_is_transient_multicast(const struct in6_addr *addr) |
41 | { | 41 | { |
42 | if (ipv6_addr_is_multicast(addr) && IPV6_ADDR_MC_FLAG_TRANSIENT(addr)) | 42 | if (ipv6_addr_is_multicast(addr) && IPV6_ADDR_MC_FLAG_TRANSIENT(addr)) |
@@ -52,7 +52,7 @@ static inline int br_ip_equal(const struct br_ip *a, const struct br_ip *b) | |||
52 | switch (a->proto) { | 52 | switch (a->proto) { |
53 | case htons(ETH_P_IP): | 53 | case htons(ETH_P_IP): |
54 | return a->u.ip4 == b->u.ip4; | 54 | return a->u.ip4 == b->u.ip4; |
55 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 55 | #if IS_ENABLED(CONFIG_IPV6) |
56 | case htons(ETH_P_IPV6): | 56 | case htons(ETH_P_IPV6): |
57 | return ipv6_addr_equal(&a->u.ip6, &b->u.ip6); | 57 | return ipv6_addr_equal(&a->u.ip6, &b->u.ip6); |
58 | #endif | 58 | #endif |
@@ -65,7 +65,7 @@ static inline int __br_ip4_hash(struct net_bridge_mdb_htable *mdb, __be32 ip) | |||
65 | return jhash_1word(mdb->secret, (__force u32)ip) & (mdb->max - 1); | 65 | return jhash_1word(mdb->secret, (__force u32)ip) & (mdb->max - 1); |
66 | } | 66 | } |
67 | 67 | ||
68 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 68 | #if IS_ENABLED(CONFIG_IPV6) |
69 | static inline int __br_ip6_hash(struct net_bridge_mdb_htable *mdb, | 69 | static inline int __br_ip6_hash(struct net_bridge_mdb_htable *mdb, |
70 | const struct in6_addr *ip) | 70 | const struct in6_addr *ip) |
71 | { | 71 | { |
@@ -79,7 +79,7 @@ static inline int br_ip_hash(struct net_bridge_mdb_htable *mdb, | |||
79 | switch (ip->proto) { | 79 | switch (ip->proto) { |
80 | case htons(ETH_P_IP): | 80 | case htons(ETH_P_IP): |
81 | return __br_ip4_hash(mdb, ip->u.ip4); | 81 | return __br_ip4_hash(mdb, ip->u.ip4); |
82 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 82 | #if IS_ENABLED(CONFIG_IPV6) |
83 | case htons(ETH_P_IPV6): | 83 | case htons(ETH_P_IPV6): |
84 | return __br_ip6_hash(mdb, &ip->u.ip6); | 84 | return __br_ip6_hash(mdb, &ip->u.ip6); |
85 | #endif | 85 | #endif |
@@ -121,7 +121,7 @@ static struct net_bridge_mdb_entry *br_mdb_ip4_get( | |||
121 | return br_mdb_ip_get(mdb, &br_dst); | 121 | return br_mdb_ip_get(mdb, &br_dst); |
122 | } | 122 | } |
123 | 123 | ||
124 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 124 | #if IS_ENABLED(CONFIG_IPV6) |
125 | static struct net_bridge_mdb_entry *br_mdb_ip6_get( | 125 | static struct net_bridge_mdb_entry *br_mdb_ip6_get( |
126 | struct net_bridge_mdb_htable *mdb, const struct in6_addr *dst) | 126 | struct net_bridge_mdb_htable *mdb, const struct in6_addr *dst) |
127 | { | 127 | { |
@@ -152,7 +152,7 @@ struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br, | |||
152 | case htons(ETH_P_IP): | 152 | case htons(ETH_P_IP): |
153 | ip.u.ip4 = ip_hdr(skb)->daddr; | 153 | ip.u.ip4 = ip_hdr(skb)->daddr; |
154 | break; | 154 | break; |
155 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 155 | #if IS_ENABLED(CONFIG_IPV6) |
156 | case htons(ETH_P_IPV6): | 156 | case htons(ETH_P_IPV6): |
157 | ip.u.ip6 = ipv6_hdr(skb)->daddr; | 157 | ip.u.ip6 = ipv6_hdr(skb)->daddr; |
158 | break; | 158 | break; |
@@ -411,7 +411,7 @@ out: | |||
411 | return skb; | 411 | return skb; |
412 | } | 412 | } |
413 | 413 | ||
414 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 414 | #if IS_ENABLED(CONFIG_IPV6) |
415 | static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br, | 415 | static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br, |
416 | const struct in6_addr *group) | 416 | const struct in6_addr *group) |
417 | { | 417 | { |
@@ -496,7 +496,7 @@ static struct sk_buff *br_multicast_alloc_query(struct net_bridge *br, | |||
496 | switch (addr->proto) { | 496 | switch (addr->proto) { |
497 | case htons(ETH_P_IP): | 497 | case htons(ETH_P_IP): |
498 | return br_ip4_multicast_alloc_query(br, addr->u.ip4); | 498 | return br_ip4_multicast_alloc_query(br, addr->u.ip4); |
499 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 499 | #if IS_ENABLED(CONFIG_IPV6) |
500 | case htons(ETH_P_IPV6): | 500 | case htons(ETH_P_IPV6): |
501 | return br_ip6_multicast_alloc_query(br, &addr->u.ip6); | 501 | return br_ip6_multicast_alloc_query(br, &addr->u.ip6); |
502 | #endif | 502 | #endif |
@@ -773,7 +773,7 @@ static int br_ip4_multicast_add_group(struct net_bridge *br, | |||
773 | return br_multicast_add_group(br, port, &br_group); | 773 | return br_multicast_add_group(br, port, &br_group); |
774 | } | 774 | } |
775 | 775 | ||
776 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 776 | #if IS_ENABLED(CONFIG_IPV6) |
777 | static int br_ip6_multicast_add_group(struct net_bridge *br, | 777 | static int br_ip6_multicast_add_group(struct net_bridge *br, |
778 | struct net_bridge_port *port, | 778 | struct net_bridge_port *port, |
779 | const struct in6_addr *group) | 779 | const struct in6_addr *group) |
@@ -845,7 +845,7 @@ static void br_multicast_send_query(struct net_bridge *br, | |||
845 | br_group.proto = htons(ETH_P_IP); | 845 | br_group.proto = htons(ETH_P_IP); |
846 | __br_multicast_send_query(br, port, &br_group); | 846 | __br_multicast_send_query(br, port, &br_group); |
847 | 847 | ||
848 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 848 | #if IS_ENABLED(CONFIG_IPV6) |
849 | br_group.proto = htons(ETH_P_IPV6); | 849 | br_group.proto = htons(ETH_P_IPV6); |
850 | __br_multicast_send_query(br, port, &br_group); | 850 | __br_multicast_send_query(br, port, &br_group); |
851 | #endif | 851 | #endif |
@@ -989,7 +989,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge *br, | |||
989 | return err; | 989 | return err; |
990 | } | 990 | } |
991 | 991 | ||
992 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 992 | #if IS_ENABLED(CONFIG_IPV6) |
993 | static int br_ip6_multicast_mld2_report(struct net_bridge *br, | 993 | static int br_ip6_multicast_mld2_report(struct net_bridge *br, |
994 | struct net_bridge_port *port, | 994 | struct net_bridge_port *port, |
995 | struct sk_buff *skb) | 995 | struct sk_buff *skb) |
@@ -1185,7 +1185,7 @@ out: | |||
1185 | return err; | 1185 | return err; |
1186 | } | 1186 | } |
1187 | 1187 | ||
1188 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1188 | #if IS_ENABLED(CONFIG_IPV6) |
1189 | static int br_ip6_multicast_query(struct net_bridge *br, | 1189 | static int br_ip6_multicast_query(struct net_bridge *br, |
1190 | struct net_bridge_port *port, | 1190 | struct net_bridge_port *port, |
1191 | struct sk_buff *skb) | 1191 | struct sk_buff *skb) |
@@ -1334,7 +1334,7 @@ static void br_ip4_multicast_leave_group(struct net_bridge *br, | |||
1334 | br_multicast_leave_group(br, port, &br_group); | 1334 | br_multicast_leave_group(br, port, &br_group); |
1335 | } | 1335 | } |
1336 | 1336 | ||
1337 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1337 | #if IS_ENABLED(CONFIG_IPV6) |
1338 | static void br_ip6_multicast_leave_group(struct net_bridge *br, | 1338 | static void br_ip6_multicast_leave_group(struct net_bridge *br, |
1339 | struct net_bridge_port *port, | 1339 | struct net_bridge_port *port, |
1340 | const struct in6_addr *group) | 1340 | const struct in6_addr *group) |
@@ -1449,7 +1449,7 @@ err_out: | |||
1449 | return err; | 1449 | return err; |
1450 | } | 1450 | } |
1451 | 1451 | ||
1452 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1452 | #if IS_ENABLED(CONFIG_IPV6) |
1453 | static int br_multicast_ipv6_rcv(struct net_bridge *br, | 1453 | static int br_multicast_ipv6_rcv(struct net_bridge *br, |
1454 | struct net_bridge_port *port, | 1454 | struct net_bridge_port *port, |
1455 | struct sk_buff *skb) | 1455 | struct sk_buff *skb) |
@@ -1596,7 +1596,7 @@ int br_multicast_rcv(struct net_bridge *br, struct net_bridge_port *port, | |||
1596 | switch (skb->protocol) { | 1596 | switch (skb->protocol) { |
1597 | case htons(ETH_P_IP): | 1597 | case htons(ETH_P_IP): |
1598 | return br_multicast_ipv4_rcv(br, port, skb); | 1598 | return br_multicast_ipv4_rcv(br, port, skb); |
1599 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1599 | #if IS_ENABLED(CONFIG_IPV6) |
1600 | case htons(ETH_P_IPV6): | 1600 | case htons(ETH_P_IPV6): |
1601 | return br_multicast_ipv6_rcv(br, port, skb); | 1601 | return br_multicast_ipv6_rcv(br, port, skb); |
1602 | #endif | 1602 | #endif |
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 89969080c384..57dcd1489f3f 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -56,7 +56,7 @@ struct br_ip | |||
56 | { | 56 | { |
57 | union { | 57 | union { |
58 | __be32 ip4; | 58 | __be32 ip4; |
59 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 59 | #if IS_ENABLED(CONFIG_IPV6) |
60 | struct in6_addr ip6; | 60 | struct in6_addr ip6; |
61 | #endif | 61 | #endif |
62 | } u; | 62 | } u; |