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 | |
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>
48 files changed, 161 insertions, 164 deletions
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h index c9f522bd17e4..fd0628be45ce 100644 --- a/include/linux/errqueue.h +++ b/include/linux/errqueue.h | |||
@@ -25,7 +25,7 @@ struct sock_extended_err { | |||
25 | #ifdef __KERNEL__ | 25 | #ifdef __KERNEL__ |
26 | 26 | ||
27 | #include <net/ip.h> | 27 | #include <net/ip.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 | ||
@@ -34,7 +34,7 @@ struct sock_extended_err { | |||
34 | struct sock_exterr_skb { | 34 | struct sock_exterr_skb { |
35 | union { | 35 | union { |
36 | struct inet_skb_parm h4; | 36 | struct inet_skb_parm h4; |
37 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 37 | #if IS_ENABLED(CONFIG_IPV6) |
38 | struct inet6_skb_parm h6; | 38 | struct inet6_skb_parm h6; |
39 | #endif | 39 | #endif |
40 | } header; | 40 | } header; |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 0c997767429a..6318268dcaf5 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -404,7 +404,7 @@ struct tcp6_sock { | |||
404 | 404 | ||
405 | extern int inet6_sk_rebuild_header(struct sock *sk); | 405 | extern int inet6_sk_rebuild_header(struct sock *sk); |
406 | 406 | ||
407 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 407 | #if IS_ENABLED(CONFIG_IPV6) |
408 | static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) | 408 | static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) |
409 | { | 409 | { |
410 | return inet_sk(__sk)->pinet6; | 410 | return inet_sk(__sk)->pinet6; |
@@ -515,7 +515,7 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk) | |||
515 | #define inet6_rcv_saddr(__sk) NULL | 515 | #define inet6_rcv_saddr(__sk) NULL |
516 | #define tcp_twsk_ipv6only(__sk) 0 | 516 | #define tcp_twsk_ipv6only(__sk) 0 |
517 | #define inet_v6_ipv6only(__sk) 0 | 517 | #define inet_v6_ipv6only(__sk) 0 |
518 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 518 | #endif /* IS_ENABLED(CONFIG_IPV6) */ |
519 | 519 | ||
520 | #define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ | 520 | #define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ |
521 | (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ | 521 | (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index ff9abff55aa0..90b0656a869e 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -301,7 +301,7 @@ static inline int __nlm_privileged_request4(const struct sockaddr *sap) | |||
301 | return ipv4_is_loopback(sin->sin_addr.s_addr); | 301 | return ipv4_is_loopback(sin->sin_addr.s_addr); |
302 | } | 302 | } |
303 | 303 | ||
304 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 304 | #if IS_ENABLED(CONFIG_IPV6) |
305 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) | 305 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) |
306 | { | 306 | { |
307 | const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; | 307 | const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; |
@@ -314,12 +314,12 @@ static inline int __nlm_privileged_request6(const struct sockaddr *sap) | |||
314 | 314 | ||
315 | return ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK; | 315 | return ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK; |
316 | } | 316 | } |
317 | #else /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 317 | #else /* IS_ENABLED(CONFIG_IPV6) */ |
318 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) | 318 | static inline int __nlm_privileged_request6(const struct sockaddr *sap) |
319 | { | 319 | { |
320 | return 0; | 320 | return 0; |
321 | } | 321 | } |
322 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 322 | #endif /* IS_ENABLED(CONFIG_IPV6) */ |
323 | 323 | ||
324 | /* | 324 | /* |
325 | * Ensure incoming requests are from local privileged callers. | 325 | * Ensure incoming requests are from local privileged callers. |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index f15fd985b08a..2c5993a17c33 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -215,7 +215,7 @@ static inline bool __rpc_copy_addr4(struct sockaddr *dst, | |||
215 | return true; | 215 | return true; |
216 | } | 216 | } |
217 | 217 | ||
218 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 218 | #if IS_ENABLED(CONFIG_IPV6) |
219 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | 219 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, |
220 | const struct sockaddr *sap2) | 220 | const struct sockaddr *sap2) |
221 | { | 221 | { |
@@ -240,7 +240,7 @@ static inline bool __rpc_copy_addr6(struct sockaddr *dst, | |||
240 | dsin6->sin6_addr = ssin6->sin6_addr; | 240 | dsin6->sin6_addr = ssin6->sin6_addr; |
241 | return true; | 241 | return true; |
242 | } | 242 | } |
243 | #else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | 243 | #else /* !(IS_ENABLED(CONFIG_IPV6) */ |
244 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | 244 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, |
245 | const struct sockaddr *sap2) | 245 | const struct sockaddr *sap2) |
246 | { | 246 | { |
@@ -252,7 +252,7 @@ static inline bool __rpc_copy_addr6(struct sockaddr *dst, | |||
252 | { | 252 | { |
253 | return false; | 253 | return false; |
254 | } | 254 | } |
255 | #endif /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | 255 | #endif /* !(IS_ENABLED(CONFIG_IPV6) */ |
256 | 256 | ||
257 | /** | 257 | /** |
258 | * rpc_cmp_addr - compare the address portion of two sockaddrs. | 258 | * rpc_cmp_addr - compare the address portion of two sockaddrs. |
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index e46674d5daea..00cbb4384c79 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 f941964a9931..e3e405106afe 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 fd1561e88a1a..775009f9eaba 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 3bb6fa0eace0..ee547c149810 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 e505358d8999..75ca9291cf2c 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 30f6728ee98c..d542a4b28cca 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 748f91f87cd5..5299e69a32af 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 e182e13d6391..875f4895b033 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 6a72a58cde59..d3685615a8b0 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 3382615bd710..ad0e31bf7450 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 87e3c80bfa00..02f070d339ba 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 1ffb39c9f324..e39592f682c3 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) \ |
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; |
diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c index 925991ae6f52..9fbca46f3e74 100644 --- a/net/core/secure_seq.c +++ b/net/core/secure_seq.c | |||
@@ -36,7 +36,7 @@ static u32 seq_scale(u32 seq) | |||
36 | } | 36 | } |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 39 | #if IS_ENABLED(CONFIG_IPV6) |
40 | __u32 secure_tcpv6_sequence_number(const __be32 *saddr, const __be32 *daddr, | 40 | __u32 secure_tcpv6_sequence_number(const __be32 *saddr, const __be32 *daddr, |
41 | __be16 sport, __be16 dport) | 41 | __be16 sport, __be16 dport) |
42 | { | 42 | { |
@@ -156,7 +156,7 @@ u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, | |||
156 | } | 156 | } |
157 | EXPORT_SYMBOL(secure_dccp_sequence_number); | 157 | EXPORT_SYMBOL(secure_dccp_sequence_number); |
158 | 158 | ||
159 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 159 | #if IS_ENABLED(CONFIG_IPV6) |
160 | u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr, | 160 | u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr, |
161 | __be16 sport, __be16 dport) | 161 | __be16 sport, __be16 dport) |
162 | { | 162 | { |
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index 583490aaf56f..5818032e35a9 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h | |||
@@ -357,7 +357,7 @@ static inline int dccp_bad_service_code(const struct sock *sk, | |||
357 | struct dccp_skb_cb { | 357 | struct dccp_skb_cb { |
358 | union { | 358 | union { |
359 | struct inet_skb_parm h4; | 359 | struct inet_skb_parm h4; |
360 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 360 | #if IS_ENABLED(CONFIG_IPV6) |
361 | struct inet6_skb_parm h6; | 361 | struct inet6_skb_parm h6; |
362 | #endif | 362 | #endif |
363 | } header; | 363 | } header; |
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c index b50d5fd3d696..5a7f90bbffac 100644 --- a/net/dccp/minisocks.c +++ b/net/dccp/minisocks.c | |||
@@ -53,7 +53,7 @@ void dccp_time_wait(struct sock *sk, int state, int timeo) | |||
53 | if (tw != NULL) { | 53 | if (tw != NULL) { |
54 | const struct inet_connection_sock *icsk = inet_csk(sk); | 54 | const struct inet_connection_sock *icsk = inet_csk(sk); |
55 | const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1); | 55 | const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1); |
56 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 56 | #if IS_ENABLED(CONFIG_IPV6) |
57 | if (tw->tw_family == PF_INET6) { | 57 | if (tw->tw_family == PF_INET6) { |
58 | const struct ipv6_pinfo *np = inet6_sk(sk); | 58 | const struct ipv6_pinfo *np = inet6_sk(sk); |
59 | struct inet6_timewait_sock *tw6; | 59 | struct inet6_timewait_sock *tw6; |
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index a598768c616c..2e4e24476c4c 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -418,7 +418,7 @@ static inline u32 inet_synq_hash(const __be32 raddr, const __be16 rport, | |||
418 | return jhash_2words((__force u32)raddr, (__force u32)rport, rnd) & (synq_hsize - 1); | 418 | return jhash_2words((__force u32)raddr, (__force u32)rport, rnd) & (synq_hsize - 1); |
419 | } | 419 | } |
420 | 420 | ||
421 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 421 | #if IS_ENABLED(CONFIG_IPV6) |
422 | #define AF_INET_FAMILY(fam) ((fam) == AF_INET) | 422 | #define AF_INET_FAMILY(fam) ((fam) == AF_INET) |
423 | #else | 423 | #else |
424 | #define AF_INET_FAMILY(fam) 1 | 424 | #define AF_INET_FAMILY(fam) 1 |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 9b3e0b179cd2..575e28c57cc9 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -116,7 +116,7 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, | |||
116 | if (ext & (1 << (INET_DIAG_TOS - 1))) | 116 | if (ext & (1 << (INET_DIAG_TOS - 1))) |
117 | RTA_PUT_U8(skb, INET_DIAG_TOS, inet->tos); | 117 | RTA_PUT_U8(skb, INET_DIAG_TOS, inet->tos); |
118 | 118 | ||
119 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 119 | #if IS_ENABLED(CONFIG_IPV6) |
120 | if (r->idiag_family == AF_INET6) { | 120 | if (r->idiag_family == AF_INET6) { |
121 | const struct ipv6_pinfo *np = inet6_sk(sk); | 121 | const struct ipv6_pinfo *np = inet6_sk(sk); |
122 | 122 | ||
@@ -234,7 +234,7 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw, | |||
234 | r->idiag_wqueue = 0; | 234 | r->idiag_wqueue = 0; |
235 | r->idiag_uid = 0; | 235 | r->idiag_uid = 0; |
236 | r->idiag_inode = 0; | 236 | r->idiag_inode = 0; |
237 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 237 | #if IS_ENABLED(CONFIG_IPV6) |
238 | if (tw->tw_family == AF_INET6) { | 238 | if (tw->tw_family == AF_INET6) { |
239 | const struct inet6_timewait_sock *tw6 = | 239 | const struct inet6_timewait_sock *tw6 = |
240 | inet6_twsk((struct sock *)tw); | 240 | inet6_twsk((struct sock *)tw); |
@@ -286,7 +286,7 @@ int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *in_s | |||
286 | req->id.idiag_dport, req->id.idiag_src[0], | 286 | req->id.idiag_dport, req->id.idiag_src[0], |
287 | req->id.idiag_sport, req->id.idiag_if); | 287 | req->id.idiag_sport, req->id.idiag_if); |
288 | } | 288 | } |
289 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 289 | #if IS_ENABLED(CONFIG_IPV6) |
290 | else if (req->sdiag_family == AF_INET6) { | 290 | else if (req->sdiag_family == AF_INET6) { |
291 | sk = inet6_lookup(&init_net, hashinfo, | 291 | sk = inet6_lookup(&init_net, hashinfo, |
292 | (struct in6_addr *)req->id.idiag_dst, | 292 | (struct in6_addr *)req->id.idiag_dst, |
@@ -473,7 +473,7 @@ int inet_diag_bc_sk(const struct nlattr *bc, struct sock *sk) | |||
473 | return 1; | 473 | return 1; |
474 | 474 | ||
475 | entry.family = sk->sk_family; | 475 | entry.family = sk->sk_family; |
476 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 476 | #if IS_ENABLED(CONFIG_IPV6) |
477 | if (entry.family == AF_INET6) { | 477 | if (entry.family == AF_INET6) { |
478 | struct ipv6_pinfo *np = inet6_sk(sk); | 478 | struct ipv6_pinfo *np = inet6_sk(sk); |
479 | 479 | ||
@@ -571,7 +571,7 @@ static int inet_twsk_diag_dump(struct inet_timewait_sock *tw, | |||
571 | struct inet_diag_entry entry; | 571 | struct inet_diag_entry entry; |
572 | 572 | ||
573 | entry.family = tw->tw_family; | 573 | entry.family = tw->tw_family; |
574 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 574 | #if IS_ENABLED(CONFIG_IPV6) |
575 | if (tw->tw_family == AF_INET6) { | 575 | if (tw->tw_family == AF_INET6) { |
576 | struct inet6_timewait_sock *tw6 = | 576 | struct inet6_timewait_sock *tw6 = |
577 | inet6_twsk((struct sock *)tw); | 577 | inet6_twsk((struct sock *)tw); |
@@ -633,7 +633,7 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk, | |||
633 | r->idiag_wqueue = 0; | 633 | r->idiag_wqueue = 0; |
634 | r->idiag_uid = sock_i_uid(sk); | 634 | r->idiag_uid = sock_i_uid(sk); |
635 | r->idiag_inode = 0; | 635 | r->idiag_inode = 0; |
636 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 636 | #if IS_ENABLED(CONFIG_IPV6) |
637 | if (r->idiag_family == AF_INET6) { | 637 | if (r->idiag_family == AF_INET6) { |
638 | *(struct in6_addr *)r->id.idiag_src = inet6_rsk(req)->loc_addr; | 638 | *(struct in6_addr *)r->id.idiag_src = inet6_rsk(req)->loc_addr; |
639 | *(struct in6_addr *)r->id.idiag_dst = inet6_rsk(req)->rmt_addr; | 639 | *(struct in6_addr *)r->id.idiag_dst = inet6_rsk(req)->rmt_addr; |
@@ -695,13 +695,13 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk, | |||
695 | 695 | ||
696 | if (bc) { | 696 | if (bc) { |
697 | entry.saddr = | 697 | entry.saddr = |
698 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 698 | #if IS_ENABLED(CONFIG_IPV6) |
699 | (entry.family == AF_INET6) ? | 699 | (entry.family == AF_INET6) ? |
700 | inet6_rsk(req)->loc_addr.s6_addr32 : | 700 | inet6_rsk(req)->loc_addr.s6_addr32 : |
701 | #endif | 701 | #endif |
702 | &ireq->loc_addr; | 702 | &ireq->loc_addr; |
703 | entry.daddr = | 703 | entry.daddr = |
704 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 704 | #if IS_ENABLED(CONFIG_IPV6) |
705 | (entry.family == AF_INET6) ? | 705 | (entry.family == AF_INET6) ? |
706 | inet6_rsk(req)->rmt_addr.s6_addr32 : | 706 | inet6_rsk(req)->rmt_addr.s6_addr32 : |
707 | #endif | 707 | #endif |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index fe070c1593ab..2b53a1f7abf6 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include <net/rtnetlink.h> | 46 | #include <net/rtnetlink.h> |
47 | #include <net/gre.h> | 47 | #include <net/gre.h> |
48 | 48 | ||
49 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 49 | #if IS_ENABLED(CONFIG_IPV6) |
50 | #include <net/ipv6.h> | 50 | #include <net/ipv6.h> |
51 | #include <net/ip6_fib.h> | 51 | #include <net/ip6_fib.h> |
52 | #include <net/ip6_route.h> | 52 | #include <net/ip6_route.h> |
@@ -729,7 +729,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev | |||
729 | if ((dst = rt->rt_gateway) == 0) | 729 | if ((dst = rt->rt_gateway) == 0) |
730 | goto tx_error_icmp; | 730 | goto tx_error_icmp; |
731 | } | 731 | } |
732 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 732 | #if IS_ENABLED(CONFIG_IPV6) |
733 | else if (skb->protocol == htons(ETH_P_IPV6)) { | 733 | else if (skb->protocol == htons(ETH_P_IPV6)) { |
734 | struct neighbour *neigh = dst_get_neighbour_noref(skb_dst(skb)); | 734 | struct neighbour *neigh = dst_get_neighbour_noref(skb_dst(skb)); |
735 | const struct in6_addr *addr6; | 735 | const struct in6_addr *addr6; |
@@ -799,7 +799,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev | |||
799 | goto tx_error; | 799 | goto tx_error; |
800 | } | 800 | } |
801 | } | 801 | } |
802 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 802 | #if IS_ENABLED(CONFIG_IPV6) |
803 | else if (skb->protocol == htons(ETH_P_IPV6)) { | 803 | else if (skb->protocol == htons(ETH_P_IPV6)) { |
804 | struct rt6_info *rt6 = (struct rt6_info *)skb_dst(skb); | 804 | struct rt6_info *rt6 = (struct rt6_info *)skb_dst(skb); |
805 | 805 | ||
@@ -875,7 +875,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev | |||
875 | if ((iph->ttl = tiph->ttl) == 0) { | 875 | if ((iph->ttl = tiph->ttl) == 0) { |
876 | if (skb->protocol == htons(ETH_P_IP)) | 876 | if (skb->protocol == htons(ETH_P_IP)) |
877 | iph->ttl = old_iph->ttl; | 877 | iph->ttl = old_iph->ttl; |
878 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 878 | #if IS_ENABLED(CONFIG_IPV6) |
879 | else if (skb->protocol == htons(ETH_P_IPV6)) | 879 | else if (skb->protocol == htons(ETH_P_IPV6)) |
880 | iph->ttl = ((const struct ipv6hdr *)old_iph)->hop_limit; | 880 | iph->ttl = ((const struct ipv6hdr *)old_iph)->hop_limit; |
881 | #endif | 881 | #endif |
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 80d5fa450210..8aa87c19fa00 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <net/route.h> | 37 | #include <net/route.h> |
38 | #include <net/xfrm.h> | 38 | #include <net/xfrm.h> |
39 | #include <net/compat.h> | 39 | #include <net/compat.h> |
40 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 40 | #if IS_ENABLED(CONFIG_IPV6) |
41 | #include <net/transp_v6.h> | 41 | #include <net/transp_v6.h> |
42 | #endif | 42 | #endif |
43 | 43 | ||
@@ -508,7 +508,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, | |||
508 | sock_owned_by_user(sk)); | 508 | sock_owned_by_user(sk)); |
509 | if (inet->is_icsk) { | 509 | if (inet->is_icsk) { |
510 | struct inet_connection_sock *icsk = inet_csk(sk); | 510 | struct inet_connection_sock *icsk = inet_csk(sk); |
511 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 511 | #if IS_ENABLED(CONFIG_IPV6) |
512 | if (sk->sk_family == PF_INET || | 512 | if (sk->sk_family == PF_INET || |
513 | (!((1 << sk->sk_state) & | 513 | (!((1 << sk->sk_state) & |
514 | (TCPF_LISTEN | TCPF_CLOSE)) && | 514 | (TCPF_LISTEN | TCPF_CLOSE)) && |
@@ -519,7 +519,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, | |||
519 | if (opt) | 519 | if (opt) |
520 | icsk->icsk_ext_hdr_len += opt->opt.optlen; | 520 | icsk->icsk_ext_hdr_len += opt->opt.optlen; |
521 | icsk->icsk_sync_mss(sk, icsk->icsk_pmtu_cookie); | 521 | icsk->icsk_sync_mss(sk, icsk->icsk_pmtu_cookie); |
522 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 522 | #if IS_ENABLED(CONFIG_IPV6) |
523 | } | 523 | } |
524 | #endif | 524 | #endif |
525 | } | 525 | } |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 0cbb44076cfa..b9cbc351c511 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2663,7 +2663,7 @@ static void DBGUNDO(struct sock *sk, const char *msg) | |||
2663 | tp->snd_ssthresh, tp->prior_ssthresh, | 2663 | tp->snd_ssthresh, tp->prior_ssthresh, |
2664 | tp->packets_out); | 2664 | tp->packets_out); |
2665 | } | 2665 | } |
2666 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 2666 | #if IS_ENABLED(CONFIG_IPV6) |
2667 | else if (sk->sk_family == AF_INET6) { | 2667 | else if (sk->sk_family == AF_INET6) { |
2668 | struct ipv6_pinfo *np = inet6_sk(sk); | 2668 | struct ipv6_pinfo *np = inet6_sk(sk); |
2669 | printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n", | 2669 | printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n", |
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 9dc146e5ed65..550e755747e0 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -336,7 +336,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) | |||
336 | tcptw->tw_ts_recent = tp->rx_opt.ts_recent; | 336 | tcptw->tw_ts_recent = tp->rx_opt.ts_recent; |
337 | tcptw->tw_ts_recent_stamp = tp->rx_opt.ts_recent_stamp; | 337 | tcptw->tw_ts_recent_stamp = tp->rx_opt.ts_recent_stamp; |
338 | 338 | ||
339 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 339 | #if IS_ENABLED(CONFIG_IPV6) |
340 | if (tw->tw_family == PF_INET6) { | 340 | if (tw->tw_family == PF_INET6) { |
341 | struct ipv6_pinfo *np = inet6_sk(sk); | 341 | struct ipv6_pinfo *np = inet6_sk(sk); |
342 | struct inet6_timewait_sock *tw6; | 342 | struct inet6_timewait_sock *tw6; |
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 2e0f0af76c19..aa39a692f4c8 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
@@ -340,7 +340,7 @@ void tcp_retransmit_timer(struct sock *sk) | |||
340 | &inet->inet_daddr, ntohs(inet->inet_dport), | 340 | &inet->inet_daddr, ntohs(inet->inet_dport), |
341 | inet->inet_num, tp->snd_una, tp->snd_nxt); | 341 | inet->inet_num, tp->snd_una, tp->snd_nxt); |
342 | } | 342 | } |
343 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 343 | #if IS_ENABLED(CONFIG_IPV6) |
344 | else if (sk->sk_family == AF_INET6) { | 344 | else if (sk->sk_family == AF_INET6) { |
345 | struct ipv6_pinfo *np = inet6_sk(sk); | 345 | struct ipv6_pinfo *np = inet6_sk(sk); |
346 | LIMIT_NETDEBUG(KERN_DEBUG "TCP: Peer %pI6:%u/%u unexpectedly shrunk window %u:%u (repaired)\n", | 346 | LIMIT_NETDEBUG(KERN_DEBUG "TCP: Peer %pI6:%u/%u unexpectedly shrunk window %u:%u (repaired)\n", |
diff --git a/net/ipv4/tunnel4.c b/net/ipv4/tunnel4.c index ac3b3ee4b07c..01775983b997 100644 --- a/net/ipv4/tunnel4.c +++ b/net/ipv4/tunnel4.c | |||
@@ -105,7 +105,7 @@ drop: | |||
105 | return 0; | 105 | return 0; |
106 | } | 106 | } |
107 | 107 | ||
108 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 108 | #if IS_ENABLED(CONFIG_IPV6) |
109 | static int tunnel64_rcv(struct sk_buff *skb) | 109 | static int tunnel64_rcv(struct sk_buff *skb) |
110 | { | 110 | { |
111 | struct xfrm_tunnel *handler; | 111 | struct xfrm_tunnel *handler; |
@@ -134,7 +134,7 @@ static void tunnel4_err(struct sk_buff *skb, u32 info) | |||
134 | break; | 134 | break; |
135 | } | 135 | } |
136 | 136 | ||
137 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 137 | #if IS_ENABLED(CONFIG_IPV6) |
138 | static void tunnel64_err(struct sk_buff *skb, u32 info) | 138 | static void tunnel64_err(struct sk_buff *skb, u32 info) |
139 | { | 139 | { |
140 | struct xfrm_tunnel *handler; | 140 | struct xfrm_tunnel *handler; |
@@ -152,7 +152,7 @@ static const struct net_protocol tunnel4_protocol = { | |||
152 | .netns_ok = 1, | 152 | .netns_ok = 1, |
153 | }; | 153 | }; |
154 | 154 | ||
155 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 155 | #if IS_ENABLED(CONFIG_IPV6) |
156 | static const struct net_protocol tunnel64_protocol = { | 156 | static const struct net_protocol tunnel64_protocol = { |
157 | .handler = tunnel64_rcv, | 157 | .handler = tunnel64_rcv, |
158 | .err_handler = tunnel64_err, | 158 | .err_handler = tunnel64_err, |
@@ -167,7 +167,7 @@ static int __init tunnel4_init(void) | |||
167 | printk(KERN_ERR "tunnel4 init: can't add protocol\n"); | 167 | printk(KERN_ERR "tunnel4 init: can't add protocol\n"); |
168 | return -EAGAIN; | 168 | return -EAGAIN; |
169 | } | 169 | } |
170 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 170 | #if IS_ENABLED(CONFIG_IPV6) |
171 | if (inet_add_protocol(&tunnel64_protocol, IPPROTO_IPV6)) { | 171 | if (inet_add_protocol(&tunnel64_protocol, IPPROTO_IPV6)) { |
172 | printk(KERN_ERR "tunnel64 init: can't add protocol\n"); | 172 | printk(KERN_ERR "tunnel64 init: can't add protocol\n"); |
173 | inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP); | 173 | inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP); |
@@ -179,7 +179,7 @@ static int __init tunnel4_init(void) | |||
179 | 179 | ||
180 | static void __exit tunnel4_fini(void) | 180 | static void __exit tunnel4_fini(void) |
181 | { | 181 | { |
182 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 182 | #if IS_ENABLED(CONFIG_IPV6) |
183 | if (inet_del_protocol(&tunnel64_protocol, IPPROTO_IPV6)) | 183 | if (inet_del_protocol(&tunnel64_protocol, IPPROTO_IPV6)) |
184 | printk(KERN_ERR "tunnel64 close: can't remove protocol\n"); | 184 | printk(KERN_ERR "tunnel64 close: can't remove protocol\n"); |
185 | #endif | 185 | #endif |
diff --git a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c index 82806455e859..9247d9d70e9d 100644 --- a/net/ipv4/xfrm4_tunnel.c +++ b/net/ipv4/xfrm4_tunnel.c | |||
@@ -64,7 +64,7 @@ static struct xfrm_tunnel xfrm_tunnel_handler __read_mostly = { | |||
64 | .priority = 2, | 64 | .priority = 2, |
65 | }; | 65 | }; |
66 | 66 | ||
67 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 67 | #if IS_ENABLED(CONFIG_IPV6) |
68 | static struct xfrm_tunnel xfrm64_tunnel_handler __read_mostly = { | 68 | static struct xfrm_tunnel xfrm64_tunnel_handler __read_mostly = { |
69 | .handler = xfrm_tunnel_rcv, | 69 | .handler = xfrm_tunnel_rcv, |
70 | .err_handler = xfrm_tunnel_err, | 70 | .err_handler = xfrm_tunnel_err, |
@@ -84,7 +84,7 @@ static int __init ipip_init(void) | |||
84 | xfrm_unregister_type(&ipip_type, AF_INET); | 84 | xfrm_unregister_type(&ipip_type, AF_INET); |
85 | return -EAGAIN; | 85 | return -EAGAIN; |
86 | } | 86 | } |
87 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 87 | #if IS_ENABLED(CONFIG_IPV6) |
88 | if (xfrm4_tunnel_register(&xfrm64_tunnel_handler, AF_INET6)) { | 88 | if (xfrm4_tunnel_register(&xfrm64_tunnel_handler, AF_INET6)) { |
89 | printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET6\n"); | 89 | printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET6\n"); |
90 | xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET); | 90 | xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET); |
@@ -97,7 +97,7 @@ static int __init ipip_init(void) | |||
97 | 97 | ||
98 | static void __exit ipip_fini(void) | 98 | static void __exit ipip_fini(void) |
99 | { | 99 | { |
100 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 100 | #if IS_ENABLED(CONFIG_IPV6) |
101 | if (xfrm4_tunnel_deregister(&xfrm64_tunnel_handler, AF_INET6)) | 101 | if (xfrm4_tunnel_deregister(&xfrm64_tunnel_handler, AF_INET6)) |
102 | printk(KERN_INFO "ipip close: can't remove xfrm handler for AF_INET6\n"); | 102 | printk(KERN_INFO "ipip close: can't remove xfrm handler for AF_INET6\n"); |
103 | #endif | 103 | #endif |
diff --git a/net/key/af_key.c b/net/key/af_key.c index bfc0bef170cb..11dbb2255ccb 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -375,7 +375,7 @@ static int verify_address_len(const void *p) | |||
375 | const struct sadb_address *sp = p; | 375 | const struct sadb_address *sp = p; |
376 | const struct sockaddr *addr = (const struct sockaddr *)(sp + 1); | 376 | const struct sockaddr *addr = (const struct sockaddr *)(sp + 1); |
377 | const struct sockaddr_in *sin; | 377 | const struct sockaddr_in *sin; |
378 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 378 | #if IS_ENABLED(CONFIG_IPV6) |
379 | const struct sockaddr_in6 *sin6; | 379 | const struct sockaddr_in6 *sin6; |
380 | #endif | 380 | #endif |
381 | int len; | 381 | int len; |
@@ -387,7 +387,7 @@ static int verify_address_len(const void *p) | |||
387 | sp->sadb_address_prefixlen > 32) | 387 | sp->sadb_address_prefixlen > 32) |
388 | return -EINVAL; | 388 | return -EINVAL; |
389 | break; | 389 | break; |
390 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 390 | #if IS_ENABLED(CONFIG_IPV6) |
391 | case AF_INET6: | 391 | case AF_INET6: |
392 | len = DIV_ROUND_UP(sizeof(*sp) + sizeof(*sin6), sizeof(uint64_t)); | 392 | len = DIV_ROUND_UP(sizeof(*sp) + sizeof(*sin6), sizeof(uint64_t)); |
393 | if (sp->sadb_address_len != len || | 393 | if (sp->sadb_address_len != len || |
@@ -469,7 +469,7 @@ static int present_and_same_family(const struct sadb_address *src, | |||
469 | if (s_addr->sa_family != d_addr->sa_family) | 469 | if (s_addr->sa_family != d_addr->sa_family) |
470 | return 0; | 470 | return 0; |
471 | if (s_addr->sa_family != AF_INET | 471 | if (s_addr->sa_family != AF_INET |
472 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 472 | #if IS_ENABLED(CONFIG_IPV6) |
473 | && s_addr->sa_family != AF_INET6 | 473 | && s_addr->sa_family != AF_INET6 |
474 | #endif | 474 | #endif |
475 | ) | 475 | ) |
@@ -579,7 +579,7 @@ static inline int pfkey_sockaddr_len(sa_family_t family) | |||
579 | switch (family) { | 579 | switch (family) { |
580 | case AF_INET: | 580 | case AF_INET: |
581 | return sizeof(struct sockaddr_in); | 581 | return sizeof(struct sockaddr_in); |
582 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 582 | #if IS_ENABLED(CONFIG_IPV6) |
583 | case AF_INET6: | 583 | case AF_INET6: |
584 | return sizeof(struct sockaddr_in6); | 584 | return sizeof(struct sockaddr_in6); |
585 | #endif | 585 | #endif |
@@ -595,7 +595,7 @@ int pfkey_sockaddr_extract(const struct sockaddr *sa, xfrm_address_t *xaddr) | |||
595 | xaddr->a4 = | 595 | xaddr->a4 = |
596 | ((struct sockaddr_in *)sa)->sin_addr.s_addr; | 596 | ((struct sockaddr_in *)sa)->sin_addr.s_addr; |
597 | return AF_INET; | 597 | return AF_INET; |
598 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 598 | #if IS_ENABLED(CONFIG_IPV6) |
599 | case AF_INET6: | 599 | case AF_INET6: |
600 | memcpy(xaddr->a6, | 600 | memcpy(xaddr->a6, |
601 | &((struct sockaddr_in6 *)sa)->sin6_addr, | 601 | &((struct sockaddr_in6 *)sa)->sin6_addr, |
@@ -639,7 +639,7 @@ static struct xfrm_state *pfkey_xfrm_state_lookup(struct net *net, const struct | |||
639 | case AF_INET: | 639 | case AF_INET: |
640 | xaddr = (xfrm_address_t *)&((const struct sockaddr_in *)(addr + 1))->sin_addr; | 640 | xaddr = (xfrm_address_t *)&((const struct sockaddr_in *)(addr + 1))->sin_addr; |
641 | break; | 641 | break; |
642 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 642 | #if IS_ENABLED(CONFIG_IPV6) |
643 | case AF_INET6: | 643 | case AF_INET6: |
644 | xaddr = (xfrm_address_t *)&((const struct sockaddr_in6 *)(addr + 1))->sin6_addr; | 644 | xaddr = (xfrm_address_t *)&((const struct sockaddr_in6 *)(addr + 1))->sin6_addr; |
645 | break; | 645 | break; |
@@ -705,7 +705,7 @@ static unsigned int pfkey_sockaddr_fill(const xfrm_address_t *xaddr, __be16 port | |||
705 | memset(sin->sin_zero, 0, sizeof(sin->sin_zero)); | 705 | memset(sin->sin_zero, 0, sizeof(sin->sin_zero)); |
706 | return 32; | 706 | return 32; |
707 | } | 707 | } |
708 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 708 | #if IS_ENABLED(CONFIG_IPV6) |
709 | case AF_INET6: | 709 | case AF_INET6: |
710 | { | 710 | { |
711 | struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; | 711 | struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; |
@@ -1311,7 +1311,7 @@ static int pfkey_getspi(struct sock *sk, struct sk_buff *skb, const struct sadb_ | |||
1311 | xdaddr = (xfrm_address_t *)&((struct sockaddr_in *)(daddr + 1))->sin_addr.s_addr; | 1311 | xdaddr = (xfrm_address_t *)&((struct sockaddr_in *)(daddr + 1))->sin_addr.s_addr; |
1312 | xsaddr = (xfrm_address_t *)&((struct sockaddr_in *)(saddr + 1))->sin_addr.s_addr; | 1312 | xsaddr = (xfrm_address_t *)&((struct sockaddr_in *)(saddr + 1))->sin_addr.s_addr; |
1313 | break; | 1313 | break; |
1314 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1314 | #if IS_ENABLED(CONFIG_IPV6) |
1315 | case AF_INET6: | 1315 | case AF_INET6: |
1316 | xdaddr = (xfrm_address_t *)&((struct sockaddr_in6 *)(daddr + 1))->sin6_addr; | 1316 | xdaddr = (xfrm_address_t *)&((struct sockaddr_in6 *)(daddr + 1))->sin6_addr; |
1317 | xsaddr = (xfrm_address_t *)&((struct sockaddr_in6 *)(saddr + 1))->sin6_addr; | 1317 | xsaddr = (xfrm_address_t *)&((struct sockaddr_in6 *)(saddr + 1))->sin6_addr; |
@@ -3146,7 +3146,7 @@ static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt, | |||
3146 | return NULL; | 3146 | return NULL; |
3147 | } | 3147 | } |
3148 | break; | 3148 | break; |
3149 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 3149 | #if IS_ENABLED(CONFIG_IPV6) |
3150 | case AF_INET6: | 3150 | case AF_INET6: |
3151 | if (opt != IPV6_IPSEC_POLICY) { | 3151 | if (opt != IPV6_IPSEC_POLICY) { |
3152 | *dir = -EOPNOTSUPP; | 3152 | *dir = -EOPNOTSUPP; |
diff --git a/net/netfilter/xt_TEE.c b/net/netfilter/xt_TEE.c index 5f054a0dbbb1..68349c31083c 100644 --- a/net/netfilter/xt_TEE.c +++ b/net/netfilter/xt_TEE.c | |||
@@ -29,9 +29,6 @@ | |||
29 | # define WITH_CONNTRACK 1 | 29 | # define WITH_CONNTRACK 1 |
30 | # include <net/netfilter/nf_conntrack.h> | 30 | # include <net/netfilter/nf_conntrack.h> |
31 | #endif | 31 | #endif |
32 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
33 | # define WITH_IPV6 1 | ||
34 | #endif | ||
35 | 32 | ||
36 | struct xt_tee_priv { | 33 | struct xt_tee_priv { |
37 | struct notifier_block notifier; | 34 | struct notifier_block notifier; |
@@ -136,7 +133,7 @@ tee_tg4(struct sk_buff *skb, const struct xt_action_param *par) | |||
136 | return XT_CONTINUE; | 133 | return XT_CONTINUE; |
137 | } | 134 | } |
138 | 135 | ||
139 | #ifdef WITH_IPV6 | 136 | #if IS_ENABLED(CONFIG_IPV6) |
140 | static bool | 137 | static bool |
141 | tee_tg_route6(struct sk_buff *skb, const struct xt_tee_tginfo *info) | 138 | tee_tg_route6(struct sk_buff *skb, const struct xt_tee_tginfo *info) |
142 | { | 139 | { |
@@ -196,7 +193,7 @@ tee_tg6(struct sk_buff *skb, const struct xt_action_param *par) | |||
196 | } | 193 | } |
197 | return XT_CONTINUE; | 194 | return XT_CONTINUE; |
198 | } | 195 | } |
199 | #endif /* WITH_IPV6 */ | 196 | #endif |
200 | 197 | ||
201 | static int tee_netdev_event(struct notifier_block *this, unsigned long event, | 198 | static int tee_netdev_event(struct notifier_block *this, unsigned long event, |
202 | void *ptr) | 199 | void *ptr) |
@@ -276,7 +273,7 @@ static struct xt_target tee_tg_reg[] __read_mostly = { | |||
276 | .destroy = tee_tg_destroy, | 273 | .destroy = tee_tg_destroy, |
277 | .me = THIS_MODULE, | 274 | .me = THIS_MODULE, |
278 | }, | 275 | }, |
279 | #ifdef WITH_IPV6 | 276 | #if IS_ENABLED(CONFIG_IPV6) |
280 | { | 277 | { |
281 | .name = "TEE", | 278 | .name = "TEE", |
282 | .revision = 1, | 279 | .revision = 1, |
diff --git a/net/netlabel/netlabel_addrlist.c b/net/netlabel/netlabel_addrlist.c index 96b749dacc34..6f1701322fb6 100644 --- a/net/netlabel/netlabel_addrlist.c +++ b/net/netlabel/netlabel_addrlist.c | |||
@@ -96,7 +96,7 @@ struct netlbl_af4list *netlbl_af4list_search_exact(__be32 addr, | |||
96 | } | 96 | } |
97 | 97 | ||
98 | 98 | ||
99 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 99 | #if IS_ENABLED(CONFIG_IPV6) |
100 | /** | 100 | /** |
101 | * netlbl_af6list_search - Search for a matching IPv6 address entry | 101 | * netlbl_af6list_search - Search for a matching IPv6 address entry |
102 | * @addr: IPv6 address | 102 | * @addr: IPv6 address |
@@ -185,7 +185,7 @@ int netlbl_af4list_add(struct netlbl_af4list *entry, struct list_head *head) | |||
185 | return 0; | 185 | return 0; |
186 | } | 186 | } |
187 | 187 | ||
188 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 188 | #if IS_ENABLED(CONFIG_IPV6) |
189 | /** | 189 | /** |
190 | * netlbl_af6list_add - Add a new IPv6 address entry to a list | 190 | * netlbl_af6list_add - Add a new IPv6 address entry to a list |
191 | * @entry: address entry | 191 | * @entry: address entry |
@@ -263,7 +263,7 @@ struct netlbl_af4list *netlbl_af4list_remove(__be32 addr, __be32 mask, | |||
263 | return entry; | 263 | return entry; |
264 | } | 264 | } |
265 | 265 | ||
266 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 266 | #if IS_ENABLED(CONFIG_IPV6) |
267 | /** | 267 | /** |
268 | * netlbl_af6list_remove_entry - Remove an IPv6 address entry | 268 | * netlbl_af6list_remove_entry - Remove an IPv6 address entry |
269 | * @entry: address entry | 269 | * @entry: address entry |
@@ -342,7 +342,7 @@ void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf, | |||
342 | } | 342 | } |
343 | } | 343 | } |
344 | 344 | ||
345 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 345 | #if IS_ENABLED(CONFIG_IPV6) |
346 | /** | 346 | /** |
347 | * netlbl_af6list_audit_addr - Audit an IPv6 address | 347 | * netlbl_af6list_audit_addr - Audit an IPv6 address |
348 | * @audit_buf: audit buffer | 348 | * @audit_buf: audit buffer |
diff --git a/net/netlabel/netlabel_addrlist.h b/net/netlabel/netlabel_addrlist.h index fdbc1d2c7352..a1287ce18130 100644 --- a/net/netlabel/netlabel_addrlist.h +++ b/net/netlabel/netlabel_addrlist.h | |||
@@ -133,7 +133,7 @@ static inline void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf, | |||
133 | } | 133 | } |
134 | #endif | 134 | #endif |
135 | 135 | ||
136 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 136 | #if IS_ENABLED(CONFIG_IPV6) |
137 | 137 | ||
138 | #define __af6list_entry(ptr) container_of(ptr, struct netlbl_af6list, list) | 138 | #define __af6list_entry(ptr) container_of(ptr, struct netlbl_af6list, list) |
139 | 139 | ||
diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c index 3f905e5370c2..38204112b9f4 100644 --- a/net/netlabel/netlabel_domainhash.c +++ b/net/netlabel/netlabel_domainhash.c | |||
@@ -78,7 +78,7 @@ static void netlbl_domhsh_free_entry(struct rcu_head *entry) | |||
78 | struct netlbl_dom_map *ptr; | 78 | struct netlbl_dom_map *ptr; |
79 | struct netlbl_af4list *iter4; | 79 | struct netlbl_af4list *iter4; |
80 | struct netlbl_af4list *tmp4; | 80 | struct netlbl_af4list *tmp4; |
81 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 81 | #if IS_ENABLED(CONFIG_IPV6) |
82 | struct netlbl_af6list *iter6; | 82 | struct netlbl_af6list *iter6; |
83 | struct netlbl_af6list *tmp6; | 83 | struct netlbl_af6list *tmp6; |
84 | #endif /* IPv6 */ | 84 | #endif /* IPv6 */ |
@@ -90,7 +90,7 @@ static void netlbl_domhsh_free_entry(struct rcu_head *entry) | |||
90 | netlbl_af4list_remove_entry(iter4); | 90 | netlbl_af4list_remove_entry(iter4); |
91 | kfree(netlbl_domhsh_addr4_entry(iter4)); | 91 | kfree(netlbl_domhsh_addr4_entry(iter4)); |
92 | } | 92 | } |
93 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 93 | #if IS_ENABLED(CONFIG_IPV6) |
94 | netlbl_af6list_foreach_safe(iter6, tmp6, | 94 | netlbl_af6list_foreach_safe(iter6, tmp6, |
95 | &ptr->type_def.addrsel->list6) { | 95 | &ptr->type_def.addrsel->list6) { |
96 | netlbl_af6list_remove_entry(iter6); | 96 | netlbl_af6list_remove_entry(iter6); |
@@ -217,7 +217,7 @@ static void netlbl_domhsh_audit_add(struct netlbl_dom_map *entry, | |||
217 | cipsov4 = map4->type_def.cipsov4; | 217 | cipsov4 = map4->type_def.cipsov4; |
218 | netlbl_af4list_audit_addr(audit_buf, 0, NULL, | 218 | netlbl_af4list_audit_addr(audit_buf, 0, NULL, |
219 | addr4->addr, addr4->mask); | 219 | addr4->addr, addr4->mask); |
220 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 220 | #if IS_ENABLED(CONFIG_IPV6) |
221 | } else if (addr6 != NULL) { | 221 | } else if (addr6 != NULL) { |
222 | struct netlbl_domaddr6_map *map6; | 222 | struct netlbl_domaddr6_map *map6; |
223 | map6 = netlbl_domhsh_addr6_entry(addr6); | 223 | map6 = netlbl_domhsh_addr6_entry(addr6); |
@@ -306,7 +306,7 @@ int netlbl_domhsh_add(struct netlbl_dom_map *entry, | |||
306 | struct netlbl_dom_map *entry_old; | 306 | struct netlbl_dom_map *entry_old; |
307 | struct netlbl_af4list *iter4; | 307 | struct netlbl_af4list *iter4; |
308 | struct netlbl_af4list *tmp4; | 308 | struct netlbl_af4list *tmp4; |
309 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 309 | #if IS_ENABLED(CONFIG_IPV6) |
310 | struct netlbl_af6list *iter6; | 310 | struct netlbl_af6list *iter6; |
311 | struct netlbl_af6list *tmp6; | 311 | struct netlbl_af6list *tmp6; |
312 | #endif /* IPv6 */ | 312 | #endif /* IPv6 */ |
@@ -338,7 +338,7 @@ int netlbl_domhsh_add(struct netlbl_dom_map *entry, | |||
338 | &entry->type_def.addrsel->list4) | 338 | &entry->type_def.addrsel->list4) |
339 | netlbl_domhsh_audit_add(entry, iter4, NULL, | 339 | netlbl_domhsh_audit_add(entry, iter4, NULL, |
340 | ret_val, audit_info); | 340 | ret_val, audit_info); |
341 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 341 | #if IS_ENABLED(CONFIG_IPV6) |
342 | netlbl_af6list_foreach_rcu(iter6, | 342 | netlbl_af6list_foreach_rcu(iter6, |
343 | &entry->type_def.addrsel->list6) | 343 | &entry->type_def.addrsel->list6) |
344 | netlbl_domhsh_audit_add(entry, NULL, iter6, | 344 | netlbl_domhsh_audit_add(entry, NULL, iter6, |
@@ -365,7 +365,7 @@ int netlbl_domhsh_add(struct netlbl_dom_map *entry, | |||
365 | ret_val = -EEXIST; | 365 | ret_val = -EEXIST; |
366 | goto add_return; | 366 | goto add_return; |
367 | } | 367 | } |
368 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 368 | #if IS_ENABLED(CONFIG_IPV6) |
369 | netlbl_af6list_foreach_rcu(iter6, | 369 | netlbl_af6list_foreach_rcu(iter6, |
370 | &entry->type_def.addrsel->list6) | 370 | &entry->type_def.addrsel->list6) |
371 | if (netlbl_af6list_search_exact(&iter6->addr, | 371 | if (netlbl_af6list_search_exact(&iter6->addr, |
@@ -386,7 +386,7 @@ int netlbl_domhsh_add(struct netlbl_dom_map *entry, | |||
386 | if (ret_val != 0) | 386 | if (ret_val != 0) |
387 | goto add_return; | 387 | goto add_return; |
388 | } | 388 | } |
389 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 389 | #if IS_ENABLED(CONFIG_IPV6) |
390 | netlbl_af6list_foreach_safe(iter6, tmp6, | 390 | netlbl_af6list_foreach_safe(iter6, tmp6, |
391 | &entry->type_def.addrsel->list6) { | 391 | &entry->type_def.addrsel->list6) { |
392 | netlbl_af6list_remove_entry(iter6); | 392 | netlbl_af6list_remove_entry(iter6); |
@@ -510,7 +510,7 @@ int netlbl_domhsh_remove_af4(const char *domain, | |||
510 | struct netlbl_dom_map *entry_map; | 510 | struct netlbl_dom_map *entry_map; |
511 | struct netlbl_af4list *entry_addr; | 511 | struct netlbl_af4list *entry_addr; |
512 | struct netlbl_af4list *iter4; | 512 | struct netlbl_af4list *iter4; |
513 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 513 | #if IS_ENABLED(CONFIG_IPV6) |
514 | struct netlbl_af6list *iter6; | 514 | struct netlbl_af6list *iter6; |
515 | #endif /* IPv6 */ | 515 | #endif /* IPv6 */ |
516 | struct netlbl_domaddr4_map *entry; | 516 | struct netlbl_domaddr4_map *entry; |
@@ -533,7 +533,7 @@ int netlbl_domhsh_remove_af4(const char *domain, | |||
533 | goto remove_af4_failure; | 533 | goto remove_af4_failure; |
534 | netlbl_af4list_foreach_rcu(iter4, &entry_map->type_def.addrsel->list4) | 534 | netlbl_af4list_foreach_rcu(iter4, &entry_map->type_def.addrsel->list4) |
535 | goto remove_af4_single_addr; | 535 | goto remove_af4_single_addr; |
536 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 536 | #if IS_ENABLED(CONFIG_IPV6) |
537 | netlbl_af6list_foreach_rcu(iter6, &entry_map->type_def.addrsel->list6) | 537 | netlbl_af6list_foreach_rcu(iter6, &entry_map->type_def.addrsel->list6) |
538 | goto remove_af4_single_addr; | 538 | goto remove_af4_single_addr; |
539 | #endif /* IPv6 */ | 539 | #endif /* IPv6 */ |
@@ -644,7 +644,7 @@ struct netlbl_domaddr4_map *netlbl_domhsh_getentry_af4(const char *domain, | |||
644 | return netlbl_domhsh_addr4_entry(addr_iter); | 644 | return netlbl_domhsh_addr4_entry(addr_iter); |
645 | } | 645 | } |
646 | 646 | ||
647 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 647 | #if IS_ENABLED(CONFIG_IPV6) |
648 | /** | 648 | /** |
649 | * netlbl_domhsh_getentry_af6 - Get an entry from the domain hash table | 649 | * netlbl_domhsh_getentry_af6 - Get an entry from the domain hash table |
650 | * @domain: the domain name to search for | 650 | * @domain: the domain name to search for |
diff --git a/net/netlabel/netlabel_domainhash.h b/net/netlabel/netlabel_domainhash.h index bfcc0f7024c5..90872c4ca30f 100644 --- a/net/netlabel/netlabel_domainhash.h +++ b/net/netlabel/netlabel_domainhash.h | |||
@@ -104,7 +104,7 @@ int netlbl_domhsh_walk(u32 *skip_bkt, | |||
104 | int (*callback) (struct netlbl_dom_map *entry, void *arg), | 104 | int (*callback) (struct netlbl_dom_map *entry, void *arg), |
105 | void *cb_arg); | 105 | void *cb_arg); |
106 | 106 | ||
107 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 107 | #if IS_ENABLED(CONFIG_IPV6) |
108 | struct netlbl_domaddr6_map *netlbl_domhsh_getentry_af6(const char *domain, | 108 | struct netlbl_domaddr6_map *netlbl_domhsh_getentry_af6(const char *domain, |
109 | const struct in6_addr *addr); | 109 | const struct in6_addr *addr); |
110 | #endif /* IPv6 */ | 110 | #endif /* IPv6 */ |
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c index 5952237c0c86..2560e7b441c6 100644 --- a/net/netlabel/netlabel_kapi.c +++ b/net/netlabel/netlabel_kapi.c | |||
@@ -147,7 +147,7 @@ int netlbl_cfg_unlbl_map_add(const char *domain, | |||
147 | goto cfg_unlbl_map_add_failure; | 147 | goto cfg_unlbl_map_add_failure; |
148 | break; | 148 | break; |
149 | } | 149 | } |
150 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 150 | #if IS_ENABLED(CONFIG_IPV6) |
151 | case AF_INET6: { | 151 | case AF_INET6: { |
152 | const struct in6_addr *addr6 = addr; | 152 | const struct in6_addr *addr6 = addr; |
153 | const struct in6_addr *mask6 = mask; | 153 | const struct in6_addr *mask6 = mask; |
@@ -227,7 +227,7 @@ int netlbl_cfg_unlbl_static_add(struct net *net, | |||
227 | case AF_INET: | 227 | case AF_INET: |
228 | addr_len = sizeof(struct in_addr); | 228 | addr_len = sizeof(struct in_addr); |
229 | break; | 229 | break; |
230 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 230 | #if IS_ENABLED(CONFIG_IPV6) |
231 | case AF_INET6: | 231 | case AF_INET6: |
232 | addr_len = sizeof(struct in6_addr); | 232 | addr_len = sizeof(struct in6_addr); |
233 | break; | 233 | break; |
@@ -270,7 +270,7 @@ int netlbl_cfg_unlbl_static_del(struct net *net, | |||
270 | case AF_INET: | 270 | case AF_INET: |
271 | addr_len = sizeof(struct in_addr); | 271 | addr_len = sizeof(struct in_addr); |
272 | break; | 272 | break; |
273 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 273 | #if IS_ENABLED(CONFIG_IPV6) |
274 | case AF_INET6: | 274 | case AF_INET6: |
275 | addr_len = sizeof(struct in6_addr); | 275 | addr_len = sizeof(struct in6_addr); |
276 | break; | 276 | break; |
@@ -673,7 +673,7 @@ int netlbl_sock_setattr(struct sock *sk, | |||
673 | ret_val = -ENOENT; | 673 | ret_val = -ENOENT; |
674 | } | 674 | } |
675 | break; | 675 | break; |
676 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 676 | #if IS_ENABLED(CONFIG_IPV6) |
677 | case AF_INET6: | 677 | case AF_INET6: |
678 | /* since we don't support any IPv6 labeling protocols right | 678 | /* since we don't support any IPv6 labeling protocols right |
679 | * now we can optimize everything away until we do */ | 679 | * now we can optimize everything away until we do */ |
@@ -724,7 +724,7 @@ int netlbl_sock_getattr(struct sock *sk, | |||
724 | case AF_INET: | 724 | case AF_INET: |
725 | ret_val = cipso_v4_sock_getattr(sk, secattr); | 725 | ret_val = cipso_v4_sock_getattr(sk, secattr); |
726 | break; | 726 | break; |
727 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 727 | #if IS_ENABLED(CONFIG_IPV6) |
728 | case AF_INET6: | 728 | case AF_INET6: |
729 | ret_val = -ENOMSG; | 729 | ret_val = -ENOMSG; |
730 | break; | 730 | break; |
@@ -782,7 +782,7 @@ int netlbl_conn_setattr(struct sock *sk, | |||
782 | ret_val = -ENOENT; | 782 | ret_val = -ENOENT; |
783 | } | 783 | } |
784 | break; | 784 | break; |
785 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 785 | #if IS_ENABLED(CONFIG_IPV6) |
786 | case AF_INET6: | 786 | case AF_INET6: |
787 | /* since we don't support any IPv6 labeling protocols right | 787 | /* since we don't support any IPv6 labeling protocols right |
788 | * now we can optimize everything away until we do */ | 788 | * now we can optimize everything away until we do */ |
@@ -853,7 +853,7 @@ int netlbl_req_setattr(struct request_sock *req, | |||
853 | ret_val = -ENOENT; | 853 | ret_val = -ENOENT; |
854 | } | 854 | } |
855 | break; | 855 | break; |
856 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 856 | #if IS_ENABLED(CONFIG_IPV6) |
857 | case AF_INET6: | 857 | case AF_INET6: |
858 | /* since we don't support any IPv6 labeling protocols right | 858 | /* since we don't support any IPv6 labeling protocols right |
859 | * now we can optimize everything away until we do */ | 859 | * now we can optimize everything away until we do */ |
@@ -926,7 +926,7 @@ int netlbl_skbuff_setattr(struct sk_buff *skb, | |||
926 | ret_val = -ENOENT; | 926 | ret_val = -ENOENT; |
927 | } | 927 | } |
928 | break; | 928 | break; |
929 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 929 | #if IS_ENABLED(CONFIG_IPV6) |
930 | case AF_INET6: | 930 | case AF_INET6: |
931 | /* since we don't support any IPv6 labeling protocols right | 931 | /* since we don't support any IPv6 labeling protocols right |
932 | * now we can optimize everything away until we do */ | 932 | * now we can optimize everything away until we do */ |
@@ -965,7 +965,7 @@ int netlbl_skbuff_getattr(const struct sk_buff *skb, | |||
965 | cipso_v4_skbuff_getattr(skb, secattr) == 0) | 965 | cipso_v4_skbuff_getattr(skb, secattr) == 0) |
966 | return 0; | 966 | return 0; |
967 | break; | 967 | break; |
968 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 968 | #if IS_ENABLED(CONFIG_IPV6) |
969 | case AF_INET6: | 969 | case AF_INET6: |
970 | break; | 970 | break; |
971 | #endif /* IPv6 */ | 971 | #endif /* IPv6 */ |
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c index 9879300beefd..4809e2e48b02 100644 --- a/net/netlabel/netlabel_mgmt.c +++ b/net/netlabel/netlabel_mgmt.c | |||
@@ -184,7 +184,7 @@ static int netlbl_mgmt_add_common(struct genl_info *info, | |||
184 | 184 | ||
185 | entry->type = NETLBL_NLTYPE_ADDRSELECT; | 185 | entry->type = NETLBL_NLTYPE_ADDRSELECT; |
186 | entry->type_def.addrsel = addrmap; | 186 | entry->type_def.addrsel = addrmap; |
187 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 187 | #if IS_ENABLED(CONFIG_IPV6) |
188 | } else if (info->attrs[NLBL_MGMT_A_IPV6ADDR]) { | 188 | } else if (info->attrs[NLBL_MGMT_A_IPV6ADDR]) { |
189 | struct in6_addr *addr; | 189 | struct in6_addr *addr; |
190 | struct in6_addr *mask; | 190 | struct in6_addr *mask; |
@@ -270,7 +270,7 @@ static int netlbl_mgmt_listentry(struct sk_buff *skb, | |||
270 | struct nlattr *nla_a; | 270 | struct nlattr *nla_a; |
271 | struct nlattr *nla_b; | 271 | struct nlattr *nla_b; |
272 | struct netlbl_af4list *iter4; | 272 | struct netlbl_af4list *iter4; |
273 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 273 | #if IS_ENABLED(CONFIG_IPV6) |
274 | struct netlbl_af6list *iter6; | 274 | struct netlbl_af6list *iter6; |
275 | #endif | 275 | #endif |
276 | 276 | ||
@@ -324,7 +324,7 @@ static int netlbl_mgmt_listentry(struct sk_buff *skb, | |||
324 | 324 | ||
325 | nla_nest_end(skb, nla_b); | 325 | nla_nest_end(skb, nla_b); |
326 | } | 326 | } |
327 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 327 | #if IS_ENABLED(CONFIG_IPV6) |
328 | netlbl_af6list_foreach_rcu(iter6, | 328 | netlbl_af6list_foreach_rcu(iter6, |
329 | &entry->type_def.addrsel->list6) { | 329 | &entry->type_def.addrsel->list6) { |
330 | struct netlbl_domaddr6_map *map6; | 330 | struct netlbl_domaddr6_map *map6; |
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index 049ccd2447d7..4b5fa0fe78fd 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -170,7 +170,7 @@ static void netlbl_unlhsh_free_iface(struct rcu_head *entry) | |||
170 | struct netlbl_unlhsh_iface *iface; | 170 | struct netlbl_unlhsh_iface *iface; |
171 | struct netlbl_af4list *iter4; | 171 | struct netlbl_af4list *iter4; |
172 | struct netlbl_af4list *tmp4; | 172 | struct netlbl_af4list *tmp4; |
173 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 173 | #if IS_ENABLED(CONFIG_IPV6) |
174 | struct netlbl_af6list *iter6; | 174 | struct netlbl_af6list *iter6; |
175 | struct netlbl_af6list *tmp6; | 175 | struct netlbl_af6list *tmp6; |
176 | #endif /* IPv6 */ | 176 | #endif /* IPv6 */ |
@@ -184,7 +184,7 @@ static void netlbl_unlhsh_free_iface(struct rcu_head *entry) | |||
184 | netlbl_af4list_remove_entry(iter4); | 184 | netlbl_af4list_remove_entry(iter4); |
185 | kfree(netlbl_unlhsh_addr4_entry(iter4)); | 185 | kfree(netlbl_unlhsh_addr4_entry(iter4)); |
186 | } | 186 | } |
187 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 187 | #if IS_ENABLED(CONFIG_IPV6) |
188 | netlbl_af6list_foreach_safe(iter6, tmp6, &iface->addr6_list) { | 188 | netlbl_af6list_foreach_safe(iter6, tmp6, &iface->addr6_list) { |
189 | netlbl_af6list_remove_entry(iter6); | 189 | netlbl_af6list_remove_entry(iter6); |
190 | kfree(netlbl_unlhsh_addr6_entry(iter6)); | 190 | kfree(netlbl_unlhsh_addr6_entry(iter6)); |
@@ -274,7 +274,7 @@ static int netlbl_unlhsh_add_addr4(struct netlbl_unlhsh_iface *iface, | |||
274 | return ret_val; | 274 | return ret_val; |
275 | } | 275 | } |
276 | 276 | ||
277 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 277 | #if IS_ENABLED(CONFIG_IPV6) |
278 | /** | 278 | /** |
279 | * netlbl_unlhsh_add_addr6 - Add a new IPv6 address entry to the hash table | 279 | * netlbl_unlhsh_add_addr6 - Add a new IPv6 address entry to the hash table |
280 | * @iface: the associated interface entry | 280 | * @iface: the associated interface entry |
@@ -436,7 +436,7 @@ int netlbl_unlhsh_add(struct net *net, | |||
436 | mask4->s_addr); | 436 | mask4->s_addr); |
437 | break; | 437 | break; |
438 | } | 438 | } |
439 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 439 | #if IS_ENABLED(CONFIG_IPV6) |
440 | case sizeof(struct in6_addr): { | 440 | case sizeof(struct in6_addr): { |
441 | const struct in6_addr *addr6 = addr; | 441 | const struct in6_addr *addr6 = addr; |
442 | const struct in6_addr *mask6 = mask; | 442 | const struct in6_addr *mask6 = mask; |
@@ -531,7 +531,7 @@ static int netlbl_unlhsh_remove_addr4(struct net *net, | |||
531 | return 0; | 531 | return 0; |
532 | } | 532 | } |
533 | 533 | ||
534 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 534 | #if IS_ENABLED(CONFIG_IPV6) |
535 | /** | 535 | /** |
536 | * netlbl_unlhsh_remove_addr6 - Remove an IPv6 address entry | 536 | * netlbl_unlhsh_remove_addr6 - Remove an IPv6 address entry |
537 | * @net: network namespace | 537 | * @net: network namespace |
@@ -606,14 +606,14 @@ static int netlbl_unlhsh_remove_addr6(struct net *net, | |||
606 | static void netlbl_unlhsh_condremove_iface(struct netlbl_unlhsh_iface *iface) | 606 | static void netlbl_unlhsh_condremove_iface(struct netlbl_unlhsh_iface *iface) |
607 | { | 607 | { |
608 | struct netlbl_af4list *iter4; | 608 | struct netlbl_af4list *iter4; |
609 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 609 | #if IS_ENABLED(CONFIG_IPV6) |
610 | struct netlbl_af6list *iter6; | 610 | struct netlbl_af6list *iter6; |
611 | #endif /* IPv6 */ | 611 | #endif /* IPv6 */ |
612 | 612 | ||
613 | spin_lock(&netlbl_unlhsh_lock); | 613 | spin_lock(&netlbl_unlhsh_lock); |
614 | netlbl_af4list_foreach_rcu(iter4, &iface->addr4_list) | 614 | netlbl_af4list_foreach_rcu(iter4, &iface->addr4_list) |
615 | goto unlhsh_condremove_failure; | 615 | goto unlhsh_condremove_failure; |
616 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 616 | #if IS_ENABLED(CONFIG_IPV6) |
617 | netlbl_af6list_foreach_rcu(iter6, &iface->addr6_list) | 617 | netlbl_af6list_foreach_rcu(iter6, &iface->addr6_list) |
618 | goto unlhsh_condremove_failure; | 618 | goto unlhsh_condremove_failure; |
619 | #endif /* IPv6 */ | 619 | #endif /* IPv6 */ |
@@ -680,7 +680,7 @@ int netlbl_unlhsh_remove(struct net *net, | |||
680 | iface, addr, mask, | 680 | iface, addr, mask, |
681 | audit_info); | 681 | audit_info); |
682 | break; | 682 | break; |
683 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 683 | #if IS_ENABLED(CONFIG_IPV6) |
684 | case sizeof(struct in6_addr): | 684 | case sizeof(struct in6_addr): |
685 | ret_val = netlbl_unlhsh_remove_addr6(net, | 685 | ret_val = netlbl_unlhsh_remove_addr6(net, |
686 | iface, addr, mask, | 686 | iface, addr, mask, |
@@ -1196,7 +1196,7 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb, | |||
1196 | struct netlbl_unlhsh_iface *iface; | 1196 | struct netlbl_unlhsh_iface *iface; |
1197 | struct list_head *iter_list; | 1197 | struct list_head *iter_list; |
1198 | struct netlbl_af4list *addr4; | 1198 | struct netlbl_af4list *addr4; |
1199 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1199 | #if IS_ENABLED(CONFIG_IPV6) |
1200 | struct netlbl_af6list *addr6; | 1200 | struct netlbl_af6list *addr6; |
1201 | #endif | 1201 | #endif |
1202 | 1202 | ||
@@ -1228,7 +1228,7 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb, | |||
1228 | goto unlabel_staticlist_return; | 1228 | goto unlabel_staticlist_return; |
1229 | } | 1229 | } |
1230 | } | 1230 | } |
1231 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1231 | #if IS_ENABLED(CONFIG_IPV6) |
1232 | netlbl_af6list_foreach_rcu(addr6, | 1232 | netlbl_af6list_foreach_rcu(addr6, |
1233 | &iface->addr6_list) { | 1233 | &iface->addr6_list) { |
1234 | if (iter_addr6++ < skip_addr6) | 1234 | if (iter_addr6++ < skip_addr6) |
@@ -1277,7 +1277,7 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb, | |||
1277 | u32 skip_addr6 = cb->args[1]; | 1277 | u32 skip_addr6 = cb->args[1]; |
1278 | u32 iter_addr4 = 0; | 1278 | u32 iter_addr4 = 0; |
1279 | struct netlbl_af4list *addr4; | 1279 | struct netlbl_af4list *addr4; |
1280 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1280 | #if IS_ENABLED(CONFIG_IPV6) |
1281 | u32 iter_addr6 = 0; | 1281 | u32 iter_addr6 = 0; |
1282 | struct netlbl_af6list *addr6; | 1282 | struct netlbl_af6list *addr6; |
1283 | #endif | 1283 | #endif |
@@ -1303,7 +1303,7 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb, | |||
1303 | goto unlabel_staticlistdef_return; | 1303 | goto unlabel_staticlistdef_return; |
1304 | } | 1304 | } |
1305 | } | 1305 | } |
1306 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1306 | #if IS_ENABLED(CONFIG_IPV6) |
1307 | netlbl_af6list_foreach_rcu(addr6, &iface->addr6_list) { | 1307 | netlbl_af6list_foreach_rcu(addr6, &iface->addr6_list) { |
1308 | if (iter_addr6++ < skip_addr6) | 1308 | if (iter_addr6++ < skip_addr6) |
1309 | continue; | 1309 | continue; |
@@ -1494,7 +1494,7 @@ int netlbl_unlabel_getattr(const struct sk_buff *skb, | |||
1494 | secattr->attr.secid = netlbl_unlhsh_addr4_entry(addr4)->secid; | 1494 | secattr->attr.secid = netlbl_unlhsh_addr4_entry(addr4)->secid; |
1495 | break; | 1495 | break; |
1496 | } | 1496 | } |
1497 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1497 | #if IS_ENABLED(CONFIG_IPV6) |
1498 | case PF_INET6: { | 1498 | case PF_INET6: { |
1499 | struct ipv6hdr *hdr6; | 1499 | struct ipv6hdr *hdr6; |
1500 | struct netlbl_af6list *addr6; | 1500 | struct netlbl_af6list *addr6; |
diff --git a/net/sctp/input.c b/net/sctp/input.c index b7692aab6e9c..80f71af71384 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -105,7 +105,7 @@ static inline int sctp_rcv_checksum(struct sk_buff *skb) | |||
105 | struct sctp_input_cb { | 105 | struct sctp_input_cb { |
106 | union { | 106 | union { |
107 | struct inet_skb_parm h4; | 107 | struct inet_skb_parm h4; |
108 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 108 | #if IS_ENABLED(CONFIG_IPV6) |
109 | struct inet6_skb_parm h6; | 109 | struct inet6_skb_parm h6; |
110 | #endif | 110 | #endif |
111 | } header; | 111 | } header; |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 61b9fca5a173..544a9b68eb53 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -637,7 +637,7 @@ void sctp_addr_wq_timeout_handler(unsigned long arg) | |||
637 | " for cmd %d at entry %p\n", &sctp_addr_waitq, &addrw->a, addrw->state, | 637 | " for cmd %d at entry %p\n", &sctp_addr_waitq, &addrw->a, addrw->state, |
638 | addrw); | 638 | addrw); |
639 | 639 | ||
640 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 640 | #if IS_ENABLED(CONFIG_IPV6) |
641 | /* Now we send an ASCONF for each association */ | 641 | /* Now we send an ASCONF for each association */ |
642 | /* Note. we currently don't handle link local IPv6 addressees */ | 642 | /* Note. we currently don't handle link local IPv6 addressees */ |
643 | if (addrw->a.sa.sa_family == AF_INET6) { | 643 | if (addrw->a.sa.sa_family == AF_INET6) { |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d56c07a3d435..db0308344d07 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -6841,7 +6841,7 @@ struct proto sctp_prot = { | |||
6841 | .sockets_allocated = &sctp_sockets_allocated, | 6841 | .sockets_allocated = &sctp_sockets_allocated, |
6842 | }; | 6842 | }; |
6843 | 6843 | ||
6844 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 6844 | #if IS_ENABLED(CONFIG_IPV6) |
6845 | 6845 | ||
6846 | struct proto sctpv6_prot = { | 6846 | struct proto sctpv6_prot = { |
6847 | .name = "SCTPv6", | 6847 | .name = "SCTPv6", |
@@ -6872,4 +6872,4 @@ struct proto sctpv6_prot = { | |||
6872 | .memory_allocated = &sctp_memory_allocated, | 6872 | .memory_allocated = &sctp_memory_allocated, |
6873 | .sockets_allocated = &sctp_sockets_allocated, | 6873 | .sockets_allocated = &sctp_sockets_allocated, |
6874 | }; | 6874 | }; |
6875 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 6875 | #endif /* IS_ENABLED(CONFIG_IPV6) */ |
diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c index 67a655ee82a9..ee77742e0ed6 100644 --- a/net/sunrpc/addr.c +++ b/net/sunrpc/addr.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
22 | #include <linux/export.h> | 22 | #include <linux/export.h> |
23 | 23 | ||
24 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 24 | #if IS_ENABLED(CONFIG_IPV6) |
25 | 25 | ||
26 | static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap, | 26 | static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap, |
27 | char *buf, const int buflen) | 27 | char *buf, const int buflen) |
@@ -91,7 +91,7 @@ static size_t rpc_ntop6(const struct sockaddr *sap, | |||
91 | return len; | 91 | return len; |
92 | } | 92 | } |
93 | 93 | ||
94 | #else /* !(defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) */ | 94 | #else /* !IS_ENABLED(CONFIG_IPV6) */ |
95 | 95 | ||
96 | static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap, | 96 | static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap, |
97 | char *buf, const int buflen) | 97 | char *buf, const int buflen) |
@@ -105,7 +105,7 @@ static size_t rpc_ntop6(const struct sockaddr *sap, | |||
105 | return 0; | 105 | return 0; |
106 | } | 106 | } |
107 | 107 | ||
108 | #endif /* !(defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) */ | 108 | #endif /* !IS_ENABLED(CONFIG_IPV6) */ |
109 | 109 | ||
110 | static int rpc_ntop4(const struct sockaddr *sap, | 110 | static int rpc_ntop4(const struct sockaddr *sap, |
111 | char *buf, const size_t buflen) | 111 | char *buf, const size_t buflen) |
@@ -155,7 +155,7 @@ static size_t rpc_pton4(const char *buf, const size_t buflen, | |||
155 | return sizeof(struct sockaddr_in); | 155 | return sizeof(struct sockaddr_in); |
156 | } | 156 | } |
157 | 157 | ||
158 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 158 | #if IS_ENABLED(CONFIG_IPV6) |
159 | static int rpc_parse_scope_id(const char *buf, const size_t buflen, | 159 | static int rpc_parse_scope_id(const char *buf, const size_t buflen, |
160 | const char *delim, struct sockaddr_in6 *sin6) | 160 | const char *delim, struct sockaddr_in6 *sin6) |
161 | { | 161 | { |
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 6e038884ae0c..9d01d46b05f3 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -826,7 +826,7 @@ static int __svc_rpcb_register4(const u32 program, const u32 version, | |||
826 | return error; | 826 | return error; |
827 | } | 827 | } |
828 | 828 | ||
829 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 829 | #if IS_ENABLED(CONFIG_IPV6) |
830 | /* | 830 | /* |
831 | * Register an "inet6" protocol family netid with the local | 831 | * Register an "inet6" protocol family netid with the local |
832 | * rpcbind daemon via an rpcbind v4 SET request. | 832 | * rpcbind daemon via an rpcbind v4 SET request. |
@@ -872,7 +872,7 @@ static int __svc_rpcb_register6(const u32 program, const u32 version, | |||
872 | 872 | ||
873 | return error; | 873 | return error; |
874 | } | 874 | } |
875 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 875 | #endif /* IS_ENABLED(CONFIG_IPV6) */ |
876 | 876 | ||
877 | /* | 877 | /* |
878 | * Register a kernel RPC service via rpcbind version 4. | 878 | * Register a kernel RPC service via rpcbind version 4. |
@@ -893,11 +893,11 @@ static int __svc_register(const char *progname, | |||
893 | error = __svc_rpcb_register4(program, version, | 893 | error = __svc_rpcb_register4(program, version, |
894 | protocol, port); | 894 | protocol, port); |
895 | break; | 895 | break; |
896 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 896 | #if IS_ENABLED(CONFIG_IPV6) |
897 | case PF_INET6: | 897 | case PF_INET6: |
898 | error = __svc_rpcb_register6(program, version, | 898 | error = __svc_rpcb_register6(program, version, |
899 | protocol, port); | 899 | protocol, port); |
900 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 900 | #endif |
901 | } | 901 | } |
902 | 902 | ||
903 | if (error < 0) | 903 | if (error < 0) |
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 447cd0eb415c..38649cfa4e81 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -179,13 +179,13 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl, | |||
179 | .sin_addr.s_addr = htonl(INADDR_ANY), | 179 | .sin_addr.s_addr = htonl(INADDR_ANY), |
180 | .sin_port = htons(port), | 180 | .sin_port = htons(port), |
181 | }; | 181 | }; |
182 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 182 | #if IS_ENABLED(CONFIG_IPV6) |
183 | struct sockaddr_in6 sin6 = { | 183 | struct sockaddr_in6 sin6 = { |
184 | .sin6_family = AF_INET6, | 184 | .sin6_family = AF_INET6, |
185 | .sin6_addr = IN6ADDR_ANY_INIT, | 185 | .sin6_addr = IN6ADDR_ANY_INIT, |
186 | .sin6_port = htons(port), | 186 | .sin6_port = htons(port), |
187 | }; | 187 | }; |
188 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 188 | #endif |
189 | struct sockaddr *sap; | 189 | struct sockaddr *sap; |
190 | size_t len; | 190 | size_t len; |
191 | 191 | ||
@@ -194,12 +194,12 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl, | |||
194 | sap = (struct sockaddr *)&sin; | 194 | sap = (struct sockaddr *)&sin; |
195 | len = sizeof(sin); | 195 | len = sizeof(sin); |
196 | break; | 196 | break; |
197 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 197 | #if IS_ENABLED(CONFIG_IPV6) |
198 | case PF_INET6: | 198 | case PF_INET6: |
199 | sap = (struct sockaddr *)&sin6; | 199 | sap = (struct sockaddr *)&sin6; |
200 | len = sizeof(sin6); | 200 | len = sizeof(sin6); |
201 | break; | 201 | break; |
202 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 202 | #endif |
203 | default: | 203 | default: |
204 | return ERR_PTR(-EAFNOSUPPORT); | 204 | return ERR_PTR(-EAFNOSUPPORT); |
205 | } | 205 | } |
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index fe258fc37f50..01153ead1dba 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c | |||
@@ -220,7 +220,7 @@ static int ip_map_parse(struct cache_detail *cd, | |||
220 | ipv6_addr_set_v4mapped(address.s4.sin_addr.s_addr, | 220 | ipv6_addr_set_v4mapped(address.s4.sin_addr.s_addr, |
221 | &sin6.sin6_addr); | 221 | &sin6.sin6_addr); |
222 | break; | 222 | break; |
223 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 223 | #if IS_ENABLED(CONFIG_IPV6) |
224 | case AF_INET6: | 224 | case AF_INET6: |
225 | memcpy(&sin6, &address.s6, sizeof(sin6)); | 225 | memcpy(&sin6, &address.s6, sizeof(sin6)); |
226 | break; | 226 | break; |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 82e803b56952..eb6b0b7781a5 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1340,7 +1340,7 @@ static inline struct xfrm_dst *xfrm_alloc_dst(struct net *net, int family) | |||
1340 | case AF_INET: | 1340 | case AF_INET: |
1341 | dst_ops = &net->xfrm.xfrm4_dst_ops; | 1341 | dst_ops = &net->xfrm.xfrm4_dst_ops; |
1342 | break; | 1342 | break; |
1343 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1343 | #if IS_ENABLED(CONFIG_IPV6) |
1344 | case AF_INET6: | 1344 | case AF_INET6: |
1345 | dst_ops = &net->xfrm.xfrm6_dst_ops; | 1345 | dst_ops = &net->xfrm.xfrm6_dst_ops; |
1346 | break; | 1346 | break; |
@@ -2435,7 +2435,7 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) | |||
2435 | case AF_INET: | 2435 | case AF_INET: |
2436 | xfrm_dst_ops = &net->xfrm.xfrm4_dst_ops; | 2436 | xfrm_dst_ops = &net->xfrm.xfrm4_dst_ops; |
2437 | break; | 2437 | break; |
2438 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 2438 | #if IS_ENABLED(CONFIG_IPV6) |
2439 | case AF_INET6: | 2439 | case AF_INET6: |
2440 | xfrm_dst_ops = &net->xfrm.xfrm6_dst_ops; | 2440 | xfrm_dst_ops = &net->xfrm.xfrm6_dst_ops; |
2441 | break; | 2441 | break; |
@@ -2485,7 +2485,7 @@ static void __net_init xfrm_dst_ops_init(struct net *net) | |||
2485 | afinfo = xfrm_policy_afinfo[AF_INET]; | 2485 | afinfo = xfrm_policy_afinfo[AF_INET]; |
2486 | if (afinfo) | 2486 | if (afinfo) |
2487 | net->xfrm.xfrm4_dst_ops = *afinfo->dst_ops; | 2487 | net->xfrm.xfrm4_dst_ops = *afinfo->dst_ops; |
2488 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 2488 | #if IS_ENABLED(CONFIG_IPV6) |
2489 | afinfo = xfrm_policy_afinfo[AF_INET6]; | 2489 | afinfo = xfrm_policy_afinfo[AF_INET6]; |
2490 | if (afinfo) | 2490 | if (afinfo) |
2491 | net->xfrm.xfrm6_dst_ops = *afinfo->dst_ops; | 2491 | net->xfrm.xfrm6_dst_ops = *afinfo->dst_ops; |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index d0a42df5160e..e0d747a2e803 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <net/netlink.h> | 28 | #include <net/netlink.h> |
29 | #include <net/ah.h> | 29 | #include <net/ah.h> |
30 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
31 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 31 | #if IS_ENABLED(CONFIG_IPV6) |
32 | #include <linux/in6.h> | 32 | #include <linux/in6.h> |
33 | #endif | 33 | #endif |
34 | 34 | ||
@@ -150,7 +150,7 @@ static int verify_newsa_info(struct xfrm_usersa_info *p, | |||
150 | break; | 150 | break; |
151 | 151 | ||
152 | case AF_INET6: | 152 | case AF_INET6: |
153 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 153 | #if IS_ENABLED(CONFIG_IPV6) |
154 | break; | 154 | break; |
155 | #else | 155 | #else |
156 | err = -EAFNOSUPPORT; | 156 | err = -EAFNOSUPPORT; |
@@ -201,7 +201,7 @@ static int verify_newsa_info(struct xfrm_usersa_info *p, | |||
201 | goto out; | 201 | goto out; |
202 | break; | 202 | break; |
203 | 203 | ||
204 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 204 | #if IS_ENABLED(CONFIG_IPV6) |
205 | case IPPROTO_DSTOPTS: | 205 | case IPPROTO_DSTOPTS: |
206 | case IPPROTO_ROUTING: | 206 | case IPPROTO_ROUTING: |
207 | if (attrs[XFRMA_ALG_COMP] || | 207 | if (attrs[XFRMA_ALG_COMP] || |
@@ -1160,7 +1160,7 @@ static int verify_newpolicy_info(struct xfrm_userpolicy_info *p) | |||
1160 | break; | 1160 | break; |
1161 | 1161 | ||
1162 | case AF_INET6: | 1162 | case AF_INET6: |
1163 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1163 | #if IS_ENABLED(CONFIG_IPV6) |
1164 | break; | 1164 | break; |
1165 | #else | 1165 | #else |
1166 | return -EAFNOSUPPORT; | 1166 | return -EAFNOSUPPORT; |
@@ -1231,7 +1231,7 @@ static int validate_tmpl(int nr, struct xfrm_user_tmpl *ut, u16 family) | |||
1231 | switch (ut[i].family) { | 1231 | switch (ut[i].family) { |
1232 | case AF_INET: | 1232 | case AF_INET: |
1233 | break; | 1233 | break; |
1234 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1234 | #if IS_ENABLED(CONFIG_IPV6) |
1235 | case AF_INET6: | 1235 | case AF_INET6: |
1236 | break; | 1236 | break; |
1237 | #endif | 1237 | #endif |
@@ -2604,7 +2604,7 @@ static struct xfrm_policy *xfrm_compile_policy(struct sock *sk, int opt, | |||
2604 | return NULL; | 2604 | return NULL; |
2605 | } | 2605 | } |
2606 | break; | 2606 | break; |
2607 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 2607 | #if IS_ENABLED(CONFIG_IPV6) |
2608 | case AF_INET6: | 2608 | case AF_INET6: |
2609 | if (opt != IPV6_XFRM_POLICY) { | 2609 | if (opt != IPV6_XFRM_POLICY) { |
2610 | *dir = -EOPNOTSUPP; | 2610 | *dir = -EOPNOTSUPP; |