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 /include/net | |
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 'include/net')
-rw-r--r-- | include/net/inet6_hashtables.h | 4 | ||||
-rw-r--r-- | include/net/inet_sock.h | 6 | ||||
-rw-r--r-- | include/net/ip.h | 6 | ||||
-rw-r--r-- | include/net/net_namespace.h | 2 | ||||
-rw-r--r-- | include/net/netfilter/nf_tproxy_core.h | 2 | ||||
-rw-r--r-- | include/net/netns/mib.h | 2 | ||||
-rw-r--r-- | include/net/netns/xfrm.h | 2 | ||||
-rw-r--r-- | include/net/protocol.h | 8 | ||||
-rw-r--r-- | include/net/sctp/sctp.h | 4 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 2 | ||||
-rw-r--r-- | include/net/tcp.h | 6 | ||||
-rw-r--r-- | include/net/udp.h | 4 |
12 files changed, 24 insertions, 24 deletions
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index e46674d5dae..00cbb4384c7 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #define _INET6_HASHTABLES_H | 15 | #define _INET6_HASHTABLES_H |
16 | 16 | ||
17 | 17 | ||
18 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 18 | #if IS_ENABLED(CONFIG_IPV6) |
19 | #include <linux/in6.h> | 19 | #include <linux/in6.h> |
20 | #include <linux/ipv6.h> | 20 | #include <linux/ipv6.h> |
21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
@@ -110,5 +110,5 @@ extern struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo | |||
110 | const struct in6_addr *saddr, const __be16 sport, | 110 | const struct in6_addr *saddr, const __be16 sport, |
111 | const struct in6_addr *daddr, const __be16 dport, | 111 | const struct in6_addr *daddr, const __be16 dport, |
112 | const int dif); | 112 | const int dif); |
113 | #endif /* defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) */ | 113 | #endif /* IS_ENABLED(CONFIG_IPV6) */ |
114 | #endif /* _INET6_HASHTABLES_H */ | 114 | #endif /* _INET6_HASHTABLES_H */ |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index f941964a993..e3e405106af 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -71,7 +71,7 @@ struct ip_options_data { | |||
71 | 71 | ||
72 | struct inet_request_sock { | 72 | struct inet_request_sock { |
73 | struct request_sock req; | 73 | struct request_sock req; |
74 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 74 | #if IS_ENABLED(CONFIG_IPV6) |
75 | u16 inet6_rsk_offset; | 75 | u16 inet6_rsk_offset; |
76 | #endif | 76 | #endif |
77 | __be16 loc_port; | 77 | __be16 loc_port; |
@@ -139,7 +139,7 @@ struct rtable; | |||
139 | struct inet_sock { | 139 | struct inet_sock { |
140 | /* sk and pinet6 has to be the first two members of inet_sock */ | 140 | /* sk and pinet6 has to be the first two members of inet_sock */ |
141 | struct sock sk; | 141 | struct sock sk; |
142 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 142 | #if IS_ENABLED(CONFIG_IPV6) |
143 | struct ipv6_pinfo *pinet6; | 143 | struct ipv6_pinfo *pinet6; |
144 | #endif | 144 | #endif |
145 | /* Socket demultiplex comparisons on incoming packets. */ | 145 | /* Socket demultiplex comparisons on incoming packets. */ |
@@ -188,7 +188,7 @@ static inline void __inet_sk_copy_descendant(struct sock *sk_to, | |||
188 | memcpy(inet_sk(sk_to) + 1, inet_sk(sk_from) + 1, | 188 | memcpy(inet_sk(sk_to) + 1, inet_sk(sk_from) + 1, |
189 | sk_from->sk_prot->obj_size - ancestor_size); | 189 | sk_from->sk_prot->obj_size - ancestor_size); |
190 | } | 190 | } |
191 | #if !(defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) | 191 | #if !(IS_ENABLED(CONFIG_IPV6)) |
192 | static inline void inet_sk_copy_descendant(struct sock *sk_to, | 192 | static inline void inet_sk_copy_descendant(struct sock *sk_to, |
193 | const struct sock *sk_from) | 193 | const struct sock *sk_from) |
194 | { | 194 | { |
diff --git a/include/net/ip.h b/include/net/ip.h index fd1561e88a1..775009f9eab 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -353,14 +353,14 @@ static inline void ip_ipgre_mc_map(__be32 naddr, const unsigned char *broadcast, | |||
353 | memcpy(buf, &naddr, sizeof(naddr)); | 353 | memcpy(buf, &naddr, sizeof(naddr)); |
354 | } | 354 | } |
355 | 355 | ||
356 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 356 | #if IS_ENABLED(CONFIG_IPV6) |
357 | #include <linux/ipv6.h> | 357 | #include <linux/ipv6.h> |
358 | #endif | 358 | #endif |
359 | 359 | ||
360 | static __inline__ void inet_reset_saddr(struct sock *sk) | 360 | static __inline__ void inet_reset_saddr(struct sock *sk) |
361 | { | 361 | { |
362 | inet_sk(sk)->inet_rcv_saddr = inet_sk(sk)->inet_saddr = 0; | 362 | inet_sk(sk)->inet_rcv_saddr = inet_sk(sk)->inet_saddr = 0; |
363 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 363 | #if IS_ENABLED(CONFIG_IPV6) |
364 | if (sk->sk_family == PF_INET6) { | 364 | if (sk->sk_family == PF_INET6) { |
365 | struct ipv6_pinfo *np = inet6_sk(sk); | 365 | struct ipv6_pinfo *np = inet6_sk(sk); |
366 | 366 | ||
@@ -379,7 +379,7 @@ static inline int sk_mc_loop(struct sock *sk) | |||
379 | switch (sk->sk_family) { | 379 | switch (sk->sk_family) { |
380 | case AF_INET: | 380 | case AF_INET: |
381 | return inet_sk(sk)->mc_loop; | 381 | return inet_sk(sk)->mc_loop; |
382 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 382 | #if IS_ENABLED(CONFIG_IPV6) |
383 | case AF_INET6: | 383 | case AF_INET6: |
384 | return inet6_sk(sk)->mc_loop; | 384 | return inet6_sk(sk)->mc_loop; |
385 | #endif | 385 | #endif |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 3bb6fa0eace..ee547c14981 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -77,7 +77,7 @@ struct net { | |||
77 | struct netns_packet packet; | 77 | struct netns_packet packet; |
78 | struct netns_unix unx; | 78 | struct netns_unix unx; |
79 | struct netns_ipv4 ipv4; | 79 | struct netns_ipv4 ipv4; |
80 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 80 | #if IS_ENABLED(CONFIG_IPV6) |
81 | struct netns_ipv6 ipv6; | 81 | struct netns_ipv6 ipv6; |
82 | #endif | 82 | #endif |
83 | #if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE) | 83 | #if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE) |
diff --git a/include/net/netfilter/nf_tproxy_core.h b/include/net/netfilter/nf_tproxy_core.h index e505358d899..75ca9291cf2 100644 --- a/include/net/netfilter/nf_tproxy_core.h +++ b/include/net/netfilter/nf_tproxy_core.h | |||
@@ -131,7 +131,7 @@ nf_tproxy_get_sock_v4(struct net *net, const u8 protocol, | |||
131 | return sk; | 131 | return sk; |
132 | } | 132 | } |
133 | 133 | ||
134 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 134 | #if IS_ENABLED(CONFIG_IPV6) |
135 | static inline struct sock * | 135 | static inline struct sock * |
136 | nf_tproxy_get_sock_v6(struct net *net, const u8 protocol, | 136 | nf_tproxy_get_sock_v6(struct net *net, const u8 protocol, |
137 | const struct in6_addr *saddr, const struct in6_addr *daddr, | 137 | const struct in6_addr *saddr, const struct in6_addr *daddr, |
diff --git a/include/net/netns/mib.h b/include/net/netns/mib.h index 30f6728ee98..d542a4b28cc 100644 --- a/include/net/netns/mib.h +++ b/include/net/netns/mib.h | |||
@@ -12,7 +12,7 @@ struct netns_mib { | |||
12 | DEFINE_SNMP_STAT(struct icmp_mib, icmp_statistics); | 12 | DEFINE_SNMP_STAT(struct icmp_mib, icmp_statistics); |
13 | DEFINE_SNMP_STAT_ATOMIC(struct icmpmsg_mib, icmpmsg_statistics); | 13 | DEFINE_SNMP_STAT_ATOMIC(struct icmpmsg_mib, icmpmsg_statistics); |
14 | 14 | ||
15 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 15 | #if IS_ENABLED(CONFIG_IPV6) |
16 | struct proc_dir_entry *proc_net_devsnmp6; | 16 | struct proc_dir_entry *proc_net_devsnmp6; |
17 | DEFINE_SNMP_STAT(struct udp_mib, udp_stats_in6); | 17 | DEFINE_SNMP_STAT(struct udp_mib, udp_stats_in6); |
18 | DEFINE_SNMP_STAT(struct udp_mib, udplite_stats_in6); | 18 | DEFINE_SNMP_STAT(struct udp_mib, udplite_stats_in6); |
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index 748f91f87cd..5299e69a32a 100644 --- a/include/net/netns/xfrm.h +++ b/include/net/netns/xfrm.h | |||
@@ -56,7 +56,7 @@ struct netns_xfrm { | |||
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | struct dst_ops xfrm4_dst_ops; | 58 | struct dst_ops xfrm4_dst_ops; |
59 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 59 | #if IS_ENABLED(CONFIG_IPV6) |
60 | struct dst_ops xfrm6_dst_ops; | 60 | struct dst_ops xfrm6_dst_ops; |
61 | #endif | 61 | #endif |
62 | }; | 62 | }; |
diff --git a/include/net/protocol.h b/include/net/protocol.h index e182e13d639..875f4895b03 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #define _PROTOCOL_H | 25 | #define _PROTOCOL_H |
26 | 26 | ||
27 | #include <linux/in6.h> | 27 | #include <linux/in6.h> |
28 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 28 | #if IS_ENABLED(CONFIG_IPV6) |
29 | #include <linux/ipv6.h> | 29 | #include <linux/ipv6.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
@@ -46,7 +46,7 @@ struct net_protocol { | |||
46 | netns_ok:1; | 46 | netns_ok:1; |
47 | }; | 47 | }; |
48 | 48 | ||
49 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 49 | #if IS_ENABLED(CONFIG_IPV6) |
50 | struct inet6_protocol { | 50 | struct inet6_protocol { |
51 | int (*handler)(struct sk_buff *skb); | 51 | int (*handler)(struct sk_buff *skb); |
52 | 52 | ||
@@ -91,7 +91,7 @@ struct inet_protosw { | |||
91 | 91 | ||
92 | extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS]; | 92 | extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS]; |
93 | 93 | ||
94 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 94 | #if IS_ENABLED(CONFIG_IPV6) |
95 | extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; | 95 | extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; |
96 | #endif | 96 | #endif |
97 | 97 | ||
@@ -100,7 +100,7 @@ extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num) | |||
100 | extern void inet_register_protosw(struct inet_protosw *p); | 100 | extern void inet_register_protosw(struct inet_protosw *p); |
101 | extern void inet_unregister_protosw(struct inet_protosw *p); | 101 | extern void inet_unregister_protosw(struct inet_protosw *p); |
102 | 102 | ||
103 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 103 | #if IS_ENABLED(CONFIG_IPV6) |
104 | extern int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num); | 104 | extern int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num); |
105 | extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num); | 105 | extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num); |
106 | extern int inet6_register_protosw(struct inet_protosw *p); | 106 | extern int inet6_register_protosw(struct inet_protosw *p); |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 6a72a58cde5..d3685615a8b 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -71,7 +71,7 @@ | |||
71 | #include <linux/jiffies.h> | 71 | #include <linux/jiffies.h> |
72 | #include <linux/idr.h> | 72 | #include <linux/idr.h> |
73 | 73 | ||
74 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 74 | #if IS_ENABLED(CONFIG_IPV6) |
75 | #include <net/ipv6.h> | 75 | #include <net/ipv6.h> |
76 | #include <net/ip6_route.h> | 76 | #include <net/ip6_route.h> |
77 | #endif | 77 | #endif |
@@ -383,7 +383,7 @@ static inline void sctp_sysctl_unregister(void) { return; } | |||
383 | /* Size of Supported Address Parameter for 'x' address types. */ | 383 | /* Size of Supported Address Parameter for 'x' address types. */ |
384 | #define SCTP_SAT_LEN(x) (sizeof(struct sctp_paramhdr) + (x) * sizeof(__u16)) | 384 | #define SCTP_SAT_LEN(x) (sizeof(struct sctp_paramhdr) + (x) * sizeof(__u16)) |
385 | 385 | ||
386 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 386 | #if IS_ENABLED(CONFIG_IPV6) |
387 | 387 | ||
388 | void sctp_v6_pf_init(void); | 388 | void sctp_v6_pf_init(void); |
389 | void sctp_v6_pf_exit(void); | 389 | void sctp_v6_pf_exit(void); |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 3382615bd71..ad0e31bf745 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -365,7 +365,7 @@ static inline struct sock *sctp_opt2sk(const struct sctp_sock *sp) | |||
365 | return (struct sock *)sp; | 365 | return (struct sock *)sp; |
366 | } | 366 | } |
367 | 367 | ||
368 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 368 | #if IS_ENABLED(CONFIG_IPV6) |
369 | struct sctp6_sock { | 369 | struct sctp6_sock { |
370 | struct sctp_sock sctp; | 370 | struct sctp_sock sctp; |
371 | struct ipv6_pinfo inet6; | 371 | struct ipv6_pinfo inet6; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 87e3c80bfa0..02f070d339b 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -628,7 +628,7 @@ extern u32 __tcp_select_window(struct sock *sk); | |||
628 | struct tcp_skb_cb { | 628 | struct tcp_skb_cb { |
629 | union { | 629 | union { |
630 | struct inet_skb_parm h4; | 630 | struct inet_skb_parm h4; |
631 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 631 | #if IS_ENABLED(CONFIG_IPV6) |
632 | struct inet6_skb_parm h6; | 632 | struct inet6_skb_parm h6; |
633 | #endif | 633 | #endif |
634 | } header; /* For incoming frames */ | 634 | } header; /* For incoming frames */ |
@@ -1152,7 +1152,7 @@ struct tcp6_md5sig_key { | |||
1152 | /* - sock block */ | 1152 | /* - sock block */ |
1153 | struct tcp_md5sig_info { | 1153 | struct tcp_md5sig_info { |
1154 | struct tcp4_md5sig_key *keys4; | 1154 | struct tcp4_md5sig_key *keys4; |
1155 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1155 | #if IS_ENABLED(CONFIG_IPV6) |
1156 | struct tcp6_md5sig_key *keys6; | 1156 | struct tcp6_md5sig_key *keys6; |
1157 | u32 entries6; | 1157 | u32 entries6; |
1158 | u32 alloced6; | 1158 | u32 alloced6; |
@@ -1179,7 +1179,7 @@ struct tcp6_pseudohdr { | |||
1179 | 1179 | ||
1180 | union tcp_md5sum_block { | 1180 | union tcp_md5sum_block { |
1181 | struct tcp4_pseudohdr ip4; | 1181 | struct tcp4_pseudohdr ip4; |
1182 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1182 | #if IS_ENABLED(CONFIG_IPV6) |
1183 | struct tcp6_pseudohdr ip6; | 1183 | struct tcp6_pseudohdr ip6; |
1184 | #endif | 1184 | #endif |
1185 | }; | 1185 | }; |
diff --git a/include/net/udp.h b/include/net/udp.h index 1ffb39c9f32..e39592f682c 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -41,7 +41,7 @@ | |||
41 | struct udp_skb_cb { | 41 | struct udp_skb_cb { |
42 | union { | 42 | union { |
43 | struct inet_skb_parm h4; | 43 | struct inet_skb_parm h4; |
44 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 44 | #if IS_ENABLED(CONFIG_IPV6) |
45 | struct inet6_skb_parm h6; | 45 | struct inet6_skb_parm h6; |
46 | #endif | 46 | #endif |
47 | } header; | 47 | } header; |
@@ -223,7 +223,7 @@ extern struct sock *__udp6_lib_lookup(struct net *net, const struct in6_addr *sa | |||
223 | else SNMP_INC_STATS_USER((net)->mib.udp_stats_in6, field); \ | 223 | else SNMP_INC_STATS_USER((net)->mib.udp_stats_in6, field); \ |
224 | } while(0) | 224 | } while(0) |
225 | 225 | ||
226 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 226 | #if IS_ENABLED(CONFIG_IPV6) |
227 | #define UDPX_INC_STATS_BH(sk, field) \ | 227 | #define UDPX_INC_STATS_BH(sk, field) \ |
228 | do { \ | 228 | do { \ |
229 | if ((sk)->sk_family == AF_INET) \ | 229 | if ((sk)->sk_family == AF_INET) \ |