Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eric Dumazet and committed by
David S. Miller
dfd56b8b 1ded132d

+161 -164
+2 -2
include/linux/errqueue.h
··· 25 25 #ifdef __KERNEL__ 26 26 27 27 #include <net/ip.h> 28 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 28 + #if IS_ENABLED(CONFIG_IPV6) 29 29 #include <linux/ipv6.h> 30 30 #endif 31 31 ··· 34 34 struct sock_exterr_skb { 35 35 union { 36 36 struct inet_skb_parm h4; 37 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 37 + #if IS_ENABLED(CONFIG_IPV6) 38 38 struct inet6_skb_parm h6; 39 39 #endif 40 40 } header;
+2 -2
include/linux/ipv6.h
··· 404 404 405 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 408 static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) 409 409 { 410 410 return inet_sk(__sk)->pinet6; ··· 515 515 #define inet6_rcv_saddr(__sk) NULL 516 516 #define tcp_twsk_ipv6only(__sk) 0 517 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 520 #define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ 521 521 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \
+3 -3
include/linux/lockd/lockd.h
··· 301 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 305 static inline int __nlm_privileged_request6(const struct sockaddr *sap) 306 306 { 307 307 const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; ··· 314 314 315 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 318 static inline int __nlm_privileged_request6(const struct sockaddr *sap) 319 319 { 320 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 325 * Ensure incoming requests are from local privileged callers.
+3 -3
include/linux/sunrpc/clnt.h
··· 215 215 return true; 216 216 } 217 217 218 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 218 + #if IS_ENABLED(CONFIG_IPV6) 219 219 static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, 220 220 const struct sockaddr *sap2) 221 221 { ··· 240 240 dsin6->sin6_addr = ssin6->sin6_addr; 241 241 return true; 242 242 } 243 - #else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ 243 + #else /* !(IS_ENABLED(CONFIG_IPV6) */ 244 244 static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, 245 245 const struct sockaddr *sap2) 246 246 { ··· 252 252 { 253 253 return false; 254 254 } 255 - #endif /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ 255 + #endif /* !(IS_ENABLED(CONFIG_IPV6) */ 256 256 257 257 /** 258 258 * rpc_cmp_addr - compare the address portion of two sockaddrs.
+2 -2
include/net/inet6_hashtables.h
··· 15 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 19 #include <linux/in6.h> 20 20 #include <linux/ipv6.h> 21 21 #include <linux/types.h> ··· 110 110 const struct in6_addr *saddr, const __be16 sport, 111 111 const struct in6_addr *daddr, const __be16 dport, 112 112 const int dif); 113 - #endif /* defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) */ 113 + #endif /* IS_ENABLED(CONFIG_IPV6) */ 114 114 #endif /* _INET6_HASHTABLES_H */
+3 -3
include/net/inet_sock.h
··· 71 71 72 72 struct inet_request_sock { 73 73 struct request_sock req; 74 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 74 + #if IS_ENABLED(CONFIG_IPV6) 75 75 u16 inet6_rsk_offset; 76 76 #endif 77 77 __be16 loc_port; ··· 139 139 struct inet_sock { 140 140 /* sk and pinet6 has to be the first two members of inet_sock */ 141 141 struct sock sk; 142 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 142 + #if IS_ENABLED(CONFIG_IPV6) 143 143 struct ipv6_pinfo *pinet6; 144 144 #endif 145 145 /* Socket demultiplex comparisons on incoming packets. */ ··· 188 188 memcpy(inet_sk(sk_to) + 1, inet_sk(sk_from) + 1, 189 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 192 static inline void inet_sk_copy_descendant(struct sock *sk_to, 193 193 const struct sock *sk_from) 194 194 {
+3 -3
include/net/ip.h
··· 353 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 357 #include <linux/ipv6.h> 358 358 #endif 359 359 360 360 static __inline__ void inet_reset_saddr(struct sock *sk) 361 361 { 362 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 364 if (sk->sk_family == PF_INET6) { 365 365 struct ipv6_pinfo *np = inet6_sk(sk); 366 366 ··· 379 379 switch (sk->sk_family) { 380 380 case AF_INET: 381 381 return inet_sk(sk)->mc_loop; 382 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 382 + #if IS_ENABLED(CONFIG_IPV6) 383 383 case AF_INET6: 384 384 return inet6_sk(sk)->mc_loop; 385 385 #endif
+1 -1
include/net/net_namespace.h
··· 77 77 struct netns_packet packet; 78 78 struct netns_unix unx; 79 79 struct netns_ipv4 ipv4; 80 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 80 + #if IS_ENABLED(CONFIG_IPV6) 81 81 struct netns_ipv6 ipv6; 82 82 #endif 83 83 #if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE)
+1 -1
include/net/netfilter/nf_tproxy_core.h
··· 131 131 return sk; 132 132 } 133 133 134 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 134 + #if IS_ENABLED(CONFIG_IPV6) 135 135 static inline struct sock * 136 136 nf_tproxy_get_sock_v6(struct net *net, const u8 protocol, 137 137 const struct in6_addr *saddr, const struct in6_addr *daddr,
+1 -1
include/net/netns/mib.h
··· 12 12 DEFINE_SNMP_STAT(struct icmp_mib, icmp_statistics); 13 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 16 struct proc_dir_entry *proc_net_devsnmp6; 17 17 DEFINE_SNMP_STAT(struct udp_mib, udp_stats_in6); 18 18 DEFINE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
+1 -1
include/net/netns/xfrm.h
··· 56 56 #endif 57 57 58 58 struct dst_ops xfrm4_dst_ops; 59 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 59 + #if IS_ENABLED(CONFIG_IPV6) 60 60 struct dst_ops xfrm6_dst_ops; 61 61 #endif 62 62 };
+4 -4
include/net/protocol.h
··· 25 25 #define _PROTOCOL_H 26 26 27 27 #include <linux/in6.h> 28 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 28 + #if IS_ENABLED(CONFIG_IPV6) 29 29 #include <linux/ipv6.h> 30 30 #endif 31 31 ··· 46 46 netns_ok:1; 47 47 }; 48 48 49 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 49 + #if IS_ENABLED(CONFIG_IPV6) 50 50 struct inet6_protocol { 51 51 int (*handler)(struct sk_buff *skb); 52 52 ··· 91 91 92 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 95 extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; 96 96 #endif 97 97 ··· 100 100 extern void inet_register_protosw(struct inet_protosw *p); 101 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 104 extern int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num); 105 105 extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num); 106 106 extern int inet6_register_protosw(struct inet_protosw *p);
+2 -2
include/net/sctp/sctp.h
··· 71 71 #include <linux/jiffies.h> 72 72 #include <linux/idr.h> 73 73 74 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 74 + #if IS_ENABLED(CONFIG_IPV6) 75 75 #include <net/ipv6.h> 76 76 #include <net/ip6_route.h> 77 77 #endif ··· 383 383 /* Size of Supported Address Parameter for 'x' address types. */ 384 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 388 void sctp_v6_pf_init(void); 389 389 void sctp_v6_pf_exit(void);
+1 -1
include/net/sctp/structs.h
··· 365 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 369 struct sctp6_sock { 370 370 struct sctp_sock sctp; 371 371 struct ipv6_pinfo inet6;
+3 -3
include/net/tcp.h
··· 628 628 struct tcp_skb_cb { 629 629 union { 630 630 struct inet_skb_parm h4; 631 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 631 + #if IS_ENABLED(CONFIG_IPV6) 632 632 struct inet6_skb_parm h6; 633 633 #endif 634 634 } header; /* For incoming frames */ ··· 1152 1152 /* - sock block */ 1153 1153 struct tcp_md5sig_info { 1154 1154 struct tcp4_md5sig_key *keys4; 1155 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 1155 + #if IS_ENABLED(CONFIG_IPV6) 1156 1156 struct tcp6_md5sig_key *keys6; 1157 1157 u32 entries6; 1158 1158 u32 alloced6; ··· 1179 1179 1180 1180 union tcp_md5sum_block { 1181 1181 struct tcp4_pseudohdr ip4; 1182 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 1182 + #if IS_ENABLED(CONFIG_IPV6) 1183 1183 struct tcp6_pseudohdr ip6; 1184 1184 #endif 1185 1185 };
+2 -2
include/net/udp.h
··· 41 41 struct udp_skb_cb { 42 42 union { 43 43 struct inet_skb_parm h4; 44 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 44 + #if IS_ENABLED(CONFIG_IPV6) 45 45 struct inet6_skb_parm h6; 46 46 #endif 47 47 } header; ··· 223 223 else SNMP_INC_STATS_USER((net)->mib.udp_stats_in6, field); \ 224 224 } while(0) 225 225 226 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 226 + #if IS_ENABLED(CONFIG_IPV6) 227 227 #define UDPX_INC_STATS_BH(sk, field) \ 228 228 do { \ 229 229 if ((sk)->sk_family == AF_INET) \
+16 -16
net/bridge/br_multicast.c
··· 24 24 #include <linux/slab.h> 25 25 #include <linux/timer.h> 26 26 #include <net/ip.h> 27 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 27 + #if IS_ENABLED(CONFIG_IPV6) 28 28 #include <net/ipv6.h> 29 29 #include <net/mld.h> 30 30 #include <net/addrconf.h> ··· 36 36 #define mlock_dereference(X, br) \ 37 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 40 static inline int ipv6_is_transient_multicast(const struct in6_addr *addr) 41 41 { 42 42 if (ipv6_addr_is_multicast(addr) && IPV6_ADDR_MC_FLAG_TRANSIENT(addr)) ··· 52 52 switch (a->proto) { 53 53 case htons(ETH_P_IP): 54 54 return a->u.ip4 == b->u.ip4; 55 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 55 + #if IS_ENABLED(CONFIG_IPV6) 56 56 case htons(ETH_P_IPV6): 57 57 return ipv6_addr_equal(&a->u.ip6, &b->u.ip6); 58 58 #endif ··· 65 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 69 static inline int __br_ip6_hash(struct net_bridge_mdb_htable *mdb, 70 70 const struct in6_addr *ip) 71 71 { ··· 79 79 switch (ip->proto) { 80 80 case htons(ETH_P_IP): 81 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 83 case htons(ETH_P_IPV6): 84 84 return __br_ip6_hash(mdb, &ip->u.ip6); 85 85 #endif ··· 121 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 125 static struct net_bridge_mdb_entry *br_mdb_ip6_get( 126 126 struct net_bridge_mdb_htable *mdb, const struct in6_addr *dst) 127 127 { ··· 152 152 case htons(ETH_P_IP): 153 153 ip.u.ip4 = ip_hdr(skb)->daddr; 154 154 break; 155 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 155 + #if IS_ENABLED(CONFIG_IPV6) 156 156 case htons(ETH_P_IPV6): 157 157 ip.u.ip6 = ipv6_hdr(skb)->daddr; 158 158 break; ··· 411 411 return skb; 412 412 } 413 413 414 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 414 + #if IS_ENABLED(CONFIG_IPV6) 415 415 static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br, 416 416 const struct in6_addr *group) 417 417 { ··· 496 496 switch (addr->proto) { 497 497 case htons(ETH_P_IP): 498 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 500 case htons(ETH_P_IPV6): 501 501 return br_ip6_multicast_alloc_query(br, &addr->u.ip6); 502 502 #endif ··· 773 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 777 static int br_ip6_multicast_add_group(struct net_bridge *br, 778 778 struct net_bridge_port *port, 779 779 const struct in6_addr *group) ··· 845 845 br_group.proto = htons(ETH_P_IP); 846 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 849 br_group.proto = htons(ETH_P_IPV6); 850 850 __br_multicast_send_query(br, port, &br_group); 851 851 #endif ··· 989 989 return err; 990 990 } 991 991 992 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 992 + #if IS_ENABLED(CONFIG_IPV6) 993 993 static int br_ip6_multicast_mld2_report(struct net_bridge *br, 994 994 struct net_bridge_port *port, 995 995 struct sk_buff *skb) ··· 1185 1185 return err; 1186 1186 } 1187 1187 1188 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 1188 + #if IS_ENABLED(CONFIG_IPV6) 1189 1189 static int br_ip6_multicast_query(struct net_bridge *br, 1190 1190 struct net_bridge_port *port, 1191 1191 struct sk_buff *skb) ··· 1334 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 1338 static void br_ip6_multicast_leave_group(struct net_bridge *br, 1339 1339 struct net_bridge_port *port, 1340 1340 const struct in6_addr *group) ··· 1449 1449 return err; 1450 1450 } 1451 1451 1452 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 1452 + #if IS_ENABLED(CONFIG_IPV6) 1453 1453 static int br_multicast_ipv6_rcv(struct net_bridge *br, 1454 1454 struct net_bridge_port *port, 1455 1455 struct sk_buff *skb) ··· 1596 1596 switch (skb->protocol) { 1597 1597 case htons(ETH_P_IP): 1598 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 1600 case htons(ETH_P_IPV6): 1601 1601 return br_multicast_ipv6_rcv(br, port, skb); 1602 1602 #endif
+1 -1
net/bridge/br_private.h
··· 56 56 { 57 57 union { 58 58 __be32 ip4; 59 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 59 + #if IS_ENABLED(CONFIG_IPV6) 60 60 struct in6_addr ip6; 61 61 #endif 62 62 } u;
+2 -2
net/core/secure_seq.c
··· 36 36 } 37 37 #endif 38 38 39 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 39 + #if IS_ENABLED(CONFIG_IPV6) 40 40 __u32 secure_tcpv6_sequence_number(const __be32 *saddr, const __be32 *daddr, 41 41 __be16 sport, __be16 dport) 42 42 { ··· 156 156 } 157 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 160 u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr, 161 161 __be16 sport, __be16 dport) 162 162 {
+1 -1
net/dccp/dccp.h
··· 357 357 struct dccp_skb_cb { 358 358 union { 359 359 struct inet_skb_parm h4; 360 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 360 + #if IS_ENABLED(CONFIG_IPV6) 361 361 struct inet6_skb_parm h6; 362 362 #endif 363 363 } header;
+1 -1
net/dccp/minisocks.c
··· 53 53 if (tw != NULL) { 54 54 const struct inet_connection_sock *icsk = inet_csk(sk); 55 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 57 if (tw->tw_family == PF_INET6) { 58 58 const struct ipv6_pinfo *np = inet6_sk(sk); 59 59 struct inet6_timewait_sock *tw6;
+1 -1
net/ipv4/inet_connection_sock.c
··· 418 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 422 #define AF_INET_FAMILY(fam) ((fam) == AF_INET) 423 423 #else 424 424 #define AF_INET_FAMILY(fam) 1
+8 -8
net/ipv4/inet_diag.c
··· 116 116 if (ext & (1 << (INET_DIAG_TOS - 1))) 117 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 120 if (r->idiag_family == AF_INET6) { 121 121 const struct ipv6_pinfo *np = inet6_sk(sk); 122 122 ··· 234 234 r->idiag_wqueue = 0; 235 235 r->idiag_uid = 0; 236 236 r->idiag_inode = 0; 237 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 237 + #if IS_ENABLED(CONFIG_IPV6) 238 238 if (tw->tw_family == AF_INET6) { 239 239 const struct inet6_timewait_sock *tw6 = 240 240 inet6_twsk((struct sock *)tw); ··· 286 286 req->id.idiag_dport, req->id.idiag_src[0], 287 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 290 else if (req->sdiag_family == AF_INET6) { 291 291 sk = inet6_lookup(&init_net, hashinfo, 292 292 (struct in6_addr *)req->id.idiag_dst, ··· 473 473 return 1; 474 474 475 475 entry.family = sk->sk_family; 476 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 476 + #if IS_ENABLED(CONFIG_IPV6) 477 477 if (entry.family == AF_INET6) { 478 478 struct ipv6_pinfo *np = inet6_sk(sk); 479 479 ··· 571 571 struct inet_diag_entry entry; 572 572 573 573 entry.family = tw->tw_family; 574 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 574 + #if IS_ENABLED(CONFIG_IPV6) 575 575 if (tw->tw_family == AF_INET6) { 576 576 struct inet6_timewait_sock *tw6 = 577 577 inet6_twsk((struct sock *)tw); ··· 633 633 r->idiag_wqueue = 0; 634 634 r->idiag_uid = sock_i_uid(sk); 635 635 r->idiag_inode = 0; 636 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 636 + #if IS_ENABLED(CONFIG_IPV6) 637 637 if (r->idiag_family == AF_INET6) { 638 638 *(struct in6_addr *)r->id.idiag_src = inet6_rsk(req)->loc_addr; 639 639 *(struct in6_addr *)r->id.idiag_dst = inet6_rsk(req)->rmt_addr; ··· 695 695 696 696 if (bc) { 697 697 entry.saddr = 698 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 698 + #if IS_ENABLED(CONFIG_IPV6) 699 699 (entry.family == AF_INET6) ? 700 700 inet6_rsk(req)->loc_addr.s6_addr32 : 701 701 #endif 702 702 &ireq->loc_addr; 703 703 entry.daddr = 704 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 704 + #if IS_ENABLED(CONFIG_IPV6) 705 705 (entry.family == AF_INET6) ? 706 706 inet6_rsk(req)->rmt_addr.s6_addr32 : 707 707 #endif
+4 -4
net/ipv4/ip_gre.c
··· 46 46 #include <net/rtnetlink.h> 47 47 #include <net/gre.h> 48 48 49 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 49 + #if IS_ENABLED(CONFIG_IPV6) 50 50 #include <net/ipv6.h> 51 51 #include <net/ip6_fib.h> 52 52 #include <net/ip6_route.h> ··· 729 729 if ((dst = rt->rt_gateway) == 0) 730 730 goto tx_error_icmp; 731 731 } 732 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 732 + #if IS_ENABLED(CONFIG_IPV6) 733 733 else if (skb->protocol == htons(ETH_P_IPV6)) { 734 734 struct neighbour *neigh = dst_get_neighbour_noref(skb_dst(skb)); 735 735 const struct in6_addr *addr6; ··· 799 799 goto tx_error; 800 800 } 801 801 } 802 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 802 + #if IS_ENABLED(CONFIG_IPV6) 803 803 else if (skb->protocol == htons(ETH_P_IPV6)) { 804 804 struct rt6_info *rt6 = (struct rt6_info *)skb_dst(skb); 805 805 ··· 875 875 if ((iph->ttl = tiph->ttl) == 0) { 876 876 if (skb->protocol == htons(ETH_P_IP)) 877 877 iph->ttl = old_iph->ttl; 878 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 878 + #if IS_ENABLED(CONFIG_IPV6) 879 879 else if (skb->protocol == htons(ETH_P_IPV6)) 880 880 iph->ttl = ((const struct ipv6hdr *)old_iph)->hop_limit; 881 881 #endif
+3 -3
net/ipv4/ip_sockglue.c
··· 37 37 #include <net/route.h> 38 38 #include <net/xfrm.h> 39 39 #include <net/compat.h> 40 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 40 + #if IS_ENABLED(CONFIG_IPV6) 41 41 #include <net/transp_v6.h> 42 42 #endif 43 43 ··· 508 508 sock_owned_by_user(sk)); 509 509 if (inet->is_icsk) { 510 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 512 if (sk->sk_family == PF_INET || 513 513 (!((1 << sk->sk_state) & 514 514 (TCPF_LISTEN | TCPF_CLOSE)) && ··· 519 519 if (opt) 520 520 icsk->icsk_ext_hdr_len += opt->opt.optlen; 521 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 524 #endif 525 525 }
+1 -1
net/ipv4/tcp_input.c
··· 2663 2663 tp->snd_ssthresh, tp->prior_ssthresh, 2664 2664 tp->packets_out); 2665 2665 } 2666 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 2666 + #if IS_ENABLED(CONFIG_IPV6) 2667 2667 else if (sk->sk_family == AF_INET6) { 2668 2668 struct ipv6_pinfo *np = inet6_sk(sk); 2669 2669 printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n",
+1 -1
net/ipv4/tcp_minisocks.c
··· 336 336 tcptw->tw_ts_recent = tp->rx_opt.ts_recent; 337 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 340 if (tw->tw_family == PF_INET6) { 341 341 struct ipv6_pinfo *np = inet6_sk(sk); 342 342 struct inet6_timewait_sock *tw6;
+1 -1
net/ipv4/tcp_timer.c
··· 340 340 &inet->inet_daddr, ntohs(inet->inet_dport), 341 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 344 else if (sk->sk_family == AF_INET6) { 345 345 struct ipv6_pinfo *np = inet6_sk(sk); 346 346 LIMIT_NETDEBUG(KERN_DEBUG "TCP: Peer %pI6:%u/%u unexpectedly shrunk window %u:%u (repaired)\n",
+5 -5
net/ipv4/tunnel4.c
··· 105 105 return 0; 106 106 } 107 107 108 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 108 + #if IS_ENABLED(CONFIG_IPV6) 109 109 static int tunnel64_rcv(struct sk_buff *skb) 110 110 { 111 111 struct xfrm_tunnel *handler; ··· 134 134 break; 135 135 } 136 136 137 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 137 + #if IS_ENABLED(CONFIG_IPV6) 138 138 static void tunnel64_err(struct sk_buff *skb, u32 info) 139 139 { 140 140 struct xfrm_tunnel *handler; ··· 152 152 .netns_ok = 1, 153 153 }; 154 154 155 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 155 + #if IS_ENABLED(CONFIG_IPV6) 156 156 static const struct net_protocol tunnel64_protocol = { 157 157 .handler = tunnel64_rcv, 158 158 .err_handler = tunnel64_err, ··· 167 167 printk(KERN_ERR "tunnel4 init: can't add protocol\n"); 168 168 return -EAGAIN; 169 169 } 170 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 170 + #if IS_ENABLED(CONFIG_IPV6) 171 171 if (inet_add_protocol(&tunnel64_protocol, IPPROTO_IPV6)) { 172 172 printk(KERN_ERR "tunnel64 init: can't add protocol\n"); 173 173 inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP); ··· 179 179 180 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 183 if (inet_del_protocol(&tunnel64_protocol, IPPROTO_IPV6)) 184 184 printk(KERN_ERR "tunnel64 close: can't remove protocol\n"); 185 185 #endif
+3 -3
net/ipv4/xfrm4_tunnel.c
··· 64 64 .priority = 2, 65 65 }; 66 66 67 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 67 + #if IS_ENABLED(CONFIG_IPV6) 68 68 static struct xfrm_tunnel xfrm64_tunnel_handler __read_mostly = { 69 69 .handler = xfrm_tunnel_rcv, 70 70 .err_handler = xfrm_tunnel_err, ··· 84 84 xfrm_unregister_type(&ipip_type, AF_INET); 85 85 return -EAGAIN; 86 86 } 87 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 87 + #if IS_ENABLED(CONFIG_IPV6) 88 88 if (xfrm4_tunnel_register(&xfrm64_tunnel_handler, AF_INET6)) { 89 89 printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET6\n"); 90 90 xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET); ··· 97 97 98 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 101 if (xfrm4_tunnel_deregister(&xfrm64_tunnel_handler, AF_INET6)) 102 102 printk(KERN_INFO "ipip close: can't remove xfrm handler for AF_INET6\n"); 103 103 #endif
+9 -9
net/key/af_key.c
··· 375 375 const struct sadb_address *sp = p; 376 376 const struct sockaddr *addr = (const struct sockaddr *)(sp + 1); 377 377 const struct sockaddr_in *sin; 378 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 378 + #if IS_ENABLED(CONFIG_IPV6) 379 379 const struct sockaddr_in6 *sin6; 380 380 #endif 381 381 int len; ··· 387 387 sp->sadb_address_prefixlen > 32) 388 388 return -EINVAL; 389 389 break; 390 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 390 + #if IS_ENABLED(CONFIG_IPV6) 391 391 case AF_INET6: 392 392 len = DIV_ROUND_UP(sizeof(*sp) + sizeof(*sin6), sizeof(uint64_t)); 393 393 if (sp->sadb_address_len != len || ··· 469 469 if (s_addr->sa_family != d_addr->sa_family) 470 470 return 0; 471 471 if (s_addr->sa_family != AF_INET 472 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 472 + #if IS_ENABLED(CONFIG_IPV6) 473 473 && s_addr->sa_family != AF_INET6 474 474 #endif 475 475 ) ··· 579 579 switch (family) { 580 580 case AF_INET: 581 581 return sizeof(struct sockaddr_in); 582 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 582 + #if IS_ENABLED(CONFIG_IPV6) 583 583 case AF_INET6: 584 584 return sizeof(struct sockaddr_in6); 585 585 #endif ··· 595 595 xaddr->a4 = 596 596 ((struct sockaddr_in *)sa)->sin_addr.s_addr; 597 597 return AF_INET; 598 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 598 + #if IS_ENABLED(CONFIG_IPV6) 599 599 case AF_INET6: 600 600 memcpy(xaddr->a6, 601 601 &((struct sockaddr_in6 *)sa)->sin6_addr, ··· 639 639 case AF_INET: 640 640 xaddr = (xfrm_address_t *)&((const struct sockaddr_in *)(addr + 1))->sin_addr; 641 641 break; 642 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 642 + #if IS_ENABLED(CONFIG_IPV6) 643 643 case AF_INET6: 644 644 xaddr = (xfrm_address_t *)&((const struct sockaddr_in6 *)(addr + 1))->sin6_addr; 645 645 break; ··· 705 705 memset(sin->sin_zero, 0, sizeof(sin->sin_zero)); 706 706 return 32; 707 707 } 708 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 708 + #if IS_ENABLED(CONFIG_IPV6) 709 709 case AF_INET6: 710 710 { 711 711 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; ··· 1311 1311 xdaddr = (xfrm_address_t *)&((struct sockaddr_in *)(daddr + 1))->sin_addr.s_addr; 1312 1312 xsaddr = (xfrm_address_t *)&((struct sockaddr_in *)(saddr + 1))->sin_addr.s_addr; 1313 1313 break; 1314 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 1314 + #if IS_ENABLED(CONFIG_IPV6) 1315 1315 case AF_INET6: 1316 1316 xdaddr = (xfrm_address_t *)&((struct sockaddr_in6 *)(daddr + 1))->sin6_addr; 1317 1317 xsaddr = (xfrm_address_t *)&((struct sockaddr_in6 *)(saddr + 1))->sin6_addr; ··· 3146 3146 return NULL; 3147 3147 } 3148 3148 break; 3149 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 3149 + #if IS_ENABLED(CONFIG_IPV6) 3150 3150 case AF_INET6: 3151 3151 if (opt != IPV6_IPSEC_POLICY) { 3152 3152 *dir = -EOPNOTSUPP;
+3 -6
net/netfilter/xt_TEE.c
··· 29 29 # define WITH_CONNTRACK 1 30 30 # include <net/netfilter/nf_conntrack.h> 31 31 #endif 32 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 33 - # define WITH_IPV6 1 34 - #endif 35 32 36 33 struct xt_tee_priv { 37 34 struct notifier_block notifier; ··· 133 136 return XT_CONTINUE; 134 137 } 135 138 136 - #ifdef WITH_IPV6 139 + #if IS_ENABLED(CONFIG_IPV6) 137 140 static bool 138 141 tee_tg_route6(struct sk_buff *skb, const struct xt_tee_tginfo *info) 139 142 { ··· 193 196 } 194 197 return XT_CONTINUE; 195 198 } 196 - #endif /* WITH_IPV6 */ 199 + #endif 197 200 198 201 static int tee_netdev_event(struct notifier_block *this, unsigned long event, 199 202 void *ptr) ··· 273 276 .destroy = tee_tg_destroy, 274 277 .me = THIS_MODULE, 275 278 }, 276 - #ifdef WITH_IPV6 279 + #if IS_ENABLED(CONFIG_IPV6) 277 280 { 278 281 .name = "TEE", 279 282 .revision = 1,
+4 -4
net/netlabel/netlabel_addrlist.c
··· 96 96 } 97 97 98 98 99 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 99 + #if IS_ENABLED(CONFIG_IPV6) 100 100 /** 101 101 * netlbl_af6list_search - Search for a matching IPv6 address entry 102 102 * @addr: IPv6 address ··· 185 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 190 * netlbl_af6list_add - Add a new IPv6 address entry to a list 191 191 * @entry: address entry ··· 263 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 268 * netlbl_af6list_remove_entry - Remove an IPv6 address entry 269 269 * @entry: address entry ··· 342 342 } 343 343 } 344 344 345 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 345 + #if IS_ENABLED(CONFIG_IPV6) 346 346 /** 347 347 * netlbl_af6list_audit_addr - Audit an IPv6 address 348 348 * @audit_buf: audit buffer
+1 -1
net/netlabel/netlabel_addrlist.h
··· 133 133 } 134 134 #endif 135 135 136 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 136 + #if IS_ENABLED(CONFIG_IPV6) 137 137 138 138 #define __af6list_entry(ptr) container_of(ptr, struct netlbl_af6list, list) 139 139
+10 -10
net/netlabel/netlabel_domainhash.c
··· 78 78 struct netlbl_dom_map *ptr; 79 79 struct netlbl_af4list *iter4; 80 80 struct netlbl_af4list *tmp4; 81 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 81 + #if IS_ENABLED(CONFIG_IPV6) 82 82 struct netlbl_af6list *iter6; 83 83 struct netlbl_af6list *tmp6; 84 84 #endif /* IPv6 */ ··· 90 90 netlbl_af4list_remove_entry(iter4); 91 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 94 netlbl_af6list_foreach_safe(iter6, tmp6, 95 95 &ptr->type_def.addrsel->list6) { 96 96 netlbl_af6list_remove_entry(iter6); ··· 217 217 cipsov4 = map4->type_def.cipsov4; 218 218 netlbl_af4list_audit_addr(audit_buf, 0, NULL, 219 219 addr4->addr, addr4->mask); 220 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 220 + #if IS_ENABLED(CONFIG_IPV6) 221 221 } else if (addr6 != NULL) { 222 222 struct netlbl_domaddr6_map *map6; 223 223 map6 = netlbl_domhsh_addr6_entry(addr6); ··· 306 306 struct netlbl_dom_map *entry_old; 307 307 struct netlbl_af4list *iter4; 308 308 struct netlbl_af4list *tmp4; 309 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 309 + #if IS_ENABLED(CONFIG_IPV6) 310 310 struct netlbl_af6list *iter6; 311 311 struct netlbl_af6list *tmp6; 312 312 #endif /* IPv6 */ ··· 338 338 &entry->type_def.addrsel->list4) 339 339 netlbl_domhsh_audit_add(entry, iter4, NULL, 340 340 ret_val, audit_info); 341 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 341 + #if IS_ENABLED(CONFIG_IPV6) 342 342 netlbl_af6list_foreach_rcu(iter6, 343 343 &entry->type_def.addrsel->list6) 344 344 netlbl_domhsh_audit_add(entry, NULL, iter6, ··· 365 365 ret_val = -EEXIST; 366 366 goto add_return; 367 367 } 368 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 368 + #if IS_ENABLED(CONFIG_IPV6) 369 369 netlbl_af6list_foreach_rcu(iter6, 370 370 &entry->type_def.addrsel->list6) 371 371 if (netlbl_af6list_search_exact(&iter6->addr, ··· 386 386 if (ret_val != 0) 387 387 goto add_return; 388 388 } 389 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 389 + #if IS_ENABLED(CONFIG_IPV6) 390 390 netlbl_af6list_foreach_safe(iter6, tmp6, 391 391 &entry->type_def.addrsel->list6) { 392 392 netlbl_af6list_remove_entry(iter6); ··· 510 510 struct netlbl_dom_map *entry_map; 511 511 struct netlbl_af4list *entry_addr; 512 512 struct netlbl_af4list *iter4; 513 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 513 + #if IS_ENABLED(CONFIG_IPV6) 514 514 struct netlbl_af6list *iter6; 515 515 #endif /* IPv6 */ 516 516 struct netlbl_domaddr4_map *entry; ··· 533 533 goto remove_af4_failure; 534 534 netlbl_af4list_foreach_rcu(iter4, &entry_map->type_def.addrsel->list4) 535 535 goto remove_af4_single_addr; 536 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 536 + #if IS_ENABLED(CONFIG_IPV6) 537 537 netlbl_af6list_foreach_rcu(iter6, &entry_map->type_def.addrsel->list6) 538 538 goto remove_af4_single_addr; 539 539 #endif /* IPv6 */ ··· 644 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 649 * netlbl_domhsh_getentry_af6 - Get an entry from the domain hash table 650 650 * @domain: the domain name to search for
+1 -1
net/netlabel/netlabel_domainhash.h
··· 104 104 int (*callback) (struct netlbl_dom_map *entry, void *arg), 105 105 void *cb_arg); 106 106 107 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 107 + #if IS_ENABLED(CONFIG_IPV6) 108 108 struct netlbl_domaddr6_map *netlbl_domhsh_getentry_af6(const char *domain, 109 109 const struct in6_addr *addr); 110 110 #endif /* IPv6 */
+9 -9
net/netlabel/netlabel_kapi.c
··· 147 147 goto cfg_unlbl_map_add_failure; 148 148 break; 149 149 } 150 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 150 + #if IS_ENABLED(CONFIG_IPV6) 151 151 case AF_INET6: { 152 152 const struct in6_addr *addr6 = addr; 153 153 const struct in6_addr *mask6 = mask; ··· 227 227 case AF_INET: 228 228 addr_len = sizeof(struct in_addr); 229 229 break; 230 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 230 + #if IS_ENABLED(CONFIG_IPV6) 231 231 case AF_INET6: 232 232 addr_len = sizeof(struct in6_addr); 233 233 break; ··· 270 270 case AF_INET: 271 271 addr_len = sizeof(struct in_addr); 272 272 break; 273 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 273 + #if IS_ENABLED(CONFIG_IPV6) 274 274 case AF_INET6: 275 275 addr_len = sizeof(struct in6_addr); 276 276 break; ··· 673 673 ret_val = -ENOENT; 674 674 } 675 675 break; 676 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 676 + #if IS_ENABLED(CONFIG_IPV6) 677 677 case AF_INET6: 678 678 /* since we don't support any IPv6 labeling protocols right 679 679 * now we can optimize everything away until we do */ ··· 724 724 case AF_INET: 725 725 ret_val = cipso_v4_sock_getattr(sk, secattr); 726 726 break; 727 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 727 + #if IS_ENABLED(CONFIG_IPV6) 728 728 case AF_INET6: 729 729 ret_val = -ENOMSG; 730 730 break; ··· 782 782 ret_val = -ENOENT; 783 783 } 784 784 break; 785 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 785 + #if IS_ENABLED(CONFIG_IPV6) 786 786 case AF_INET6: 787 787 /* since we don't support any IPv6 labeling protocols right 788 788 * now we can optimize everything away until we do */ ··· 853 853 ret_val = -ENOENT; 854 854 } 855 855 break; 856 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 856 + #if IS_ENABLED(CONFIG_IPV6) 857 857 case AF_INET6: 858 858 /* since we don't support any IPv6 labeling protocols right 859 859 * now we can optimize everything away until we do */ ··· 926 926 ret_val = -ENOENT; 927 927 } 928 928 break; 929 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 929 + #if IS_ENABLED(CONFIG_IPV6) 930 930 case AF_INET6: 931 931 /* since we don't support any IPv6 labeling protocols right 932 932 * now we can optimize everything away until we do */ ··· 965 965 cipso_v4_skbuff_getattr(skb, secattr) == 0) 966 966 return 0; 967 967 break; 968 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 968 + #if IS_ENABLED(CONFIG_IPV6) 969 969 case AF_INET6: 970 970 break; 971 971 #endif /* IPv6 */
+3 -3
net/netlabel/netlabel_mgmt.c
··· 184 184 185 185 entry->type = NETLBL_NLTYPE_ADDRSELECT; 186 186 entry->type_def.addrsel = addrmap; 187 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 187 + #if IS_ENABLED(CONFIG_IPV6) 188 188 } else if (info->attrs[NLBL_MGMT_A_IPV6ADDR]) { 189 189 struct in6_addr *addr; 190 190 struct in6_addr *mask; ··· 270 270 struct nlattr *nla_a; 271 271 struct nlattr *nla_b; 272 272 struct netlbl_af4list *iter4; 273 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 273 + #if IS_ENABLED(CONFIG_IPV6) 274 274 struct netlbl_af6list *iter6; 275 275 #endif 276 276 ··· 324 324 325 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 328 netlbl_af6list_foreach_rcu(iter6, 329 329 &entry->type_def.addrsel->list6) { 330 330 struct netlbl_domaddr6_map *map6;
+13 -13
net/netlabel/netlabel_unlabeled.c
··· 170 170 struct netlbl_unlhsh_iface *iface; 171 171 struct netlbl_af4list *iter4; 172 172 struct netlbl_af4list *tmp4; 173 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 173 + #if IS_ENABLED(CONFIG_IPV6) 174 174 struct netlbl_af6list *iter6; 175 175 struct netlbl_af6list *tmp6; 176 176 #endif /* IPv6 */ ··· 184 184 netlbl_af4list_remove_entry(iter4); 185 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 188 netlbl_af6list_foreach_safe(iter6, tmp6, &iface->addr6_list) { 189 189 netlbl_af6list_remove_entry(iter6); 190 190 kfree(netlbl_unlhsh_addr6_entry(iter6)); ··· 274 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 279 * netlbl_unlhsh_add_addr6 - Add a new IPv6 address entry to the hash table 280 280 * @iface: the associated interface entry ··· 436 436 mask4->s_addr); 437 437 break; 438 438 } 439 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 439 + #if IS_ENABLED(CONFIG_IPV6) 440 440 case sizeof(struct in6_addr): { 441 441 const struct in6_addr *addr6 = addr; 442 442 const struct in6_addr *mask6 = mask; ··· 531 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 536 * netlbl_unlhsh_remove_addr6 - Remove an IPv6 address entry 537 537 * @net: network namespace ··· 606 606 static void netlbl_unlhsh_condremove_iface(struct netlbl_unlhsh_iface *iface) 607 607 { 608 608 struct netlbl_af4list *iter4; 609 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 609 + #if IS_ENABLED(CONFIG_IPV6) 610 610 struct netlbl_af6list *iter6; 611 611 #endif /* IPv6 */ 612 612 613 613 spin_lock(&netlbl_unlhsh_lock); 614 614 netlbl_af4list_foreach_rcu(iter4, &iface->addr4_list) 615 615 goto unlhsh_condremove_failure; 616 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 616 + #if IS_ENABLED(CONFIG_IPV6) 617 617 netlbl_af6list_foreach_rcu(iter6, &iface->addr6_list) 618 618 goto unlhsh_condremove_failure; 619 619 #endif /* IPv6 */ ··· 680 680 iface, addr, mask, 681 681 audit_info); 682 682 break; 683 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 683 + #if IS_ENABLED(CONFIG_IPV6) 684 684 case sizeof(struct in6_addr): 685 685 ret_val = netlbl_unlhsh_remove_addr6(net, 686 686 iface, addr, mask, ··· 1196 1196 struct netlbl_unlhsh_iface *iface; 1197 1197 struct list_head *iter_list; 1198 1198 struct netlbl_af4list *addr4; 1199 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 1199 + #if IS_ENABLED(CONFIG_IPV6) 1200 1200 struct netlbl_af6list *addr6; 1201 1201 #endif 1202 1202 ··· 1228 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 1232 netlbl_af6list_foreach_rcu(addr6, 1233 1233 &iface->addr6_list) { 1234 1234 if (iter_addr6++ < skip_addr6) ··· 1277 1277 u32 skip_addr6 = cb->args[1]; 1278 1278 u32 iter_addr4 = 0; 1279 1279 struct netlbl_af4list *addr4; 1280 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 1280 + #if IS_ENABLED(CONFIG_IPV6) 1281 1281 u32 iter_addr6 = 0; 1282 1282 struct netlbl_af6list *addr6; 1283 1283 #endif ··· 1303 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 1307 netlbl_af6list_foreach_rcu(addr6, &iface->addr6_list) { 1308 1308 if (iter_addr6++ < skip_addr6) 1309 1309 continue; ··· 1494 1494 secattr->attr.secid = netlbl_unlhsh_addr4_entry(addr4)->secid; 1495 1495 break; 1496 1496 } 1497 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 1497 + #if IS_ENABLED(CONFIG_IPV6) 1498 1498 case PF_INET6: { 1499 1499 struct ipv6hdr *hdr6; 1500 1500 struct netlbl_af6list *addr6;
+1 -1
net/sctp/input.c
··· 105 105 struct sctp_input_cb { 106 106 union { 107 107 struct inet_skb_parm h4; 108 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 108 + #if IS_ENABLED(CONFIG_IPV6) 109 109 struct inet6_skb_parm h6; 110 110 #endif 111 111 } header;
+1 -1
net/sctp/protocol.c
··· 637 637 " for cmd %d at entry %p\n", &sctp_addr_waitq, &addrw->a, addrw->state, 638 638 addrw); 639 639 640 - #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 640 + #if IS_ENABLED(CONFIG_IPV6) 641 641 /* Now we send an ASCONF for each association */ 642 642 /* Note. we currently don't handle link local IPv6 addressees */ 643 643 if (addrw->a.sa.sa_family == AF_INET6) {
+2 -2
net/sctp/socket.c
··· 6841 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 6846 struct proto sctpv6_prot = { 6847 6847 .name = "SCTPv6", ··· 6872 6872 .memory_allocated = &sctp_memory_allocated, 6873 6873 .sockets_allocated = &sctp_sockets_allocated, 6874 6874 }; 6875 - #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ 6875 + #endif /* IS_ENABLED(CONFIG_IPV6) */
+4 -4
net/sunrpc/addr.c
··· 21 21 #include <linux/slab.h> 22 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 26 static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap, 27 27 char *buf, const int buflen) ··· 91 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 96 static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap, 97 97 char *buf, const int buflen) ··· 105 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 110 static int rpc_ntop4(const struct sockaddr *sap, 111 111 char *buf, const size_t buflen) ··· 155 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 159 static int rpc_parse_scope_id(const char *buf, const size_t buflen, 160 160 const char *delim, struct sockaddr_in6 *sin6) 161 161 {
+4 -4
net/sunrpc/svc.c
··· 826 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 831 * Register an "inet6" protocol family netid with the local 832 832 * rpcbind daemon via an rpcbind v4 SET request. ··· 872 872 873 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 878 * Register a kernel RPC service via rpcbind version 4. ··· 893 893 error = __svc_rpcb_register4(program, version, 894 894 protocol, port); 895 895 break; 896 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 896 + #if IS_ENABLED(CONFIG_IPV6) 897 897 case PF_INET6: 898 898 error = __svc_rpcb_register6(program, version, 899 899 protocol, port); 900 - #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ 900 + #endif 901 901 } 902 902 903 903 if (error < 0)
+4 -4
net/sunrpc/svc_xprt.c
··· 179 179 .sin_addr.s_addr = htonl(INADDR_ANY), 180 180 .sin_port = htons(port), 181 181 }; 182 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 182 + #if IS_ENABLED(CONFIG_IPV6) 183 183 struct sockaddr_in6 sin6 = { 184 184 .sin6_family = AF_INET6, 185 185 .sin6_addr = IN6ADDR_ANY_INIT, 186 186 .sin6_port = htons(port), 187 187 }; 188 - #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ 188 + #endif 189 189 struct sockaddr *sap; 190 190 size_t len; 191 191 ··· 194 194 sap = (struct sockaddr *)&sin; 195 195 len = sizeof(sin); 196 196 break; 197 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 197 + #if IS_ENABLED(CONFIG_IPV6) 198 198 case PF_INET6: 199 199 sap = (struct sockaddr *)&sin6; 200 200 len = sizeof(sin6); 201 201 break; 202 - #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ 202 + #endif 203 203 default: 204 204 return ERR_PTR(-EAFNOSUPPORT); 205 205 }
+1 -1
net/sunrpc/svcauth_unix.c
··· 220 220 ipv6_addr_set_v4mapped(address.s4.sin_addr.s_addr, 221 221 &sin6.sin6_addr); 222 222 break; 223 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 223 + #if IS_ENABLED(CONFIG_IPV6) 224 224 case AF_INET6: 225 225 memcpy(&sin6, &address.s6, sizeof(sin6)); 226 226 break;
+3 -3
net/xfrm/xfrm_policy.c
··· 1340 1340 case AF_INET: 1341 1341 dst_ops = &net->xfrm.xfrm4_dst_ops; 1342 1342 break; 1343 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 1343 + #if IS_ENABLED(CONFIG_IPV6) 1344 1344 case AF_INET6: 1345 1345 dst_ops = &net->xfrm.xfrm6_dst_ops; 1346 1346 break; ··· 2435 2435 case AF_INET: 2436 2436 xfrm_dst_ops = &net->xfrm.xfrm4_dst_ops; 2437 2437 break; 2438 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 2438 + #if IS_ENABLED(CONFIG_IPV6) 2439 2439 case AF_INET6: 2440 2440 xfrm_dst_ops = &net->xfrm.xfrm6_dst_ops; 2441 2441 break; ··· 2485 2485 afinfo = xfrm_policy_afinfo[AF_INET]; 2486 2486 if (afinfo) 2487 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 2489 afinfo = xfrm_policy_afinfo[AF_INET6]; 2490 2490 if (afinfo) 2491 2491 net->xfrm.xfrm6_dst_ops = *afinfo->dst_ops;
+6 -6
net/xfrm/xfrm_user.c
··· 28 28 #include <net/netlink.h> 29 29 #include <net/ah.h> 30 30 #include <asm/uaccess.h> 31 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 31 + #if IS_ENABLED(CONFIG_IPV6) 32 32 #include <linux/in6.h> 33 33 #endif 34 34 ··· 150 150 break; 151 151 152 152 case AF_INET6: 153 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 153 + #if IS_ENABLED(CONFIG_IPV6) 154 154 break; 155 155 #else 156 156 err = -EAFNOSUPPORT; ··· 201 201 goto out; 202 202 break; 203 203 204 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 204 + #if IS_ENABLED(CONFIG_IPV6) 205 205 case IPPROTO_DSTOPTS: 206 206 case IPPROTO_ROUTING: 207 207 if (attrs[XFRMA_ALG_COMP] || ··· 1160 1160 break; 1161 1161 1162 1162 case AF_INET6: 1163 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 1163 + #if IS_ENABLED(CONFIG_IPV6) 1164 1164 break; 1165 1165 #else 1166 1166 return -EAFNOSUPPORT; ··· 1231 1231 switch (ut[i].family) { 1232 1232 case AF_INET: 1233 1233 break; 1234 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 1234 + #if IS_ENABLED(CONFIG_IPV6) 1235 1235 case AF_INET6: 1236 1236 break; 1237 1237 #endif ··· 2604 2604 return NULL; 2605 2605 } 2606 2606 break; 2607 - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 2607 + #if IS_ENABLED(CONFIG_IPV6) 2608 2608 case AF_INET6: 2609 2609 if (opt != IPV6_XFRM_POLICY) { 2610 2610 *dir = -EOPNOTSUPP;