diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-12-10 04:48:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-11 18:25:16 -0500 |
commit | dfd56b8b38fff3586f36232db58e1e9f7885a605 (patch) | |
tree | 64c7142ebf4625939f68bd3603f1d37bacb20a73 /net/key | |
parent | 1ded132d4c3442aa3a619c94c245d7b5e0eb9731 (diff) |
net: use IS_ENABLED(CONFIG_IPV6)
Instead of testing defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/key')
-rw-r--r-- | net/key/af_key.c | 18 |
1 files changed, 9 insertions, 9 deletions
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; |