diff options
author | NeilBrown <neilb@suse.de> | 2007-03-06 04:42:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-06 12:30:26 -0500 |
commit | 5a05ed73e1abfd7e0e7d474817245861deaa18af (patch) | |
tree | df2e9b2717719dc900be6a11db4cb33d4b237aae /net/sunrpc/svcsock.c | |
parent | 7a37f5787e76bf1765c1add3a9a7163f841a28bb (diff) |
[PATCH] knfsd: remove CONFIG_IPV6 ifdefs from sunrpc server code
They don't really save that much, and aren't worth the hassle.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r-- | net/sunrpc/svcsock.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 32b94cf19f89..e957ce55fd91 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -131,13 +131,13 @@ static char *__svc_print_addr(struct sockaddr *addr, char *buf, size_t len) | |||
131 | NIPQUAD(((struct sockaddr_in *) addr)->sin_addr), | 131 | NIPQUAD(((struct sockaddr_in *) addr)->sin_addr), |
132 | htons(((struct sockaddr_in *) addr)->sin_port)); | 132 | htons(((struct sockaddr_in *) addr)->sin_port)); |
133 | break; | 133 | break; |
134 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 134 | |
135 | case AF_INET6: | 135 | case AF_INET6: |
136 | snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", | 136 | snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", |
137 | NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), | 137 | NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), |
138 | htons(((struct sockaddr_in6 *) addr)->sin6_port)); | 138 | htons(((struct sockaddr_in6 *) addr)->sin6_port)); |
139 | break; | 139 | break; |
140 | #endif | 140 | |
141 | default: | 141 | default: |
142 | snprintf(buf, len, "unknown address type: %d", addr->sa_family); | 142 | snprintf(buf, len, "unknown address type: %d", addr->sa_family); |
143 | break; | 143 | break; |
@@ -449,9 +449,7 @@ svc_wake_up(struct svc_serv *serv) | |||
449 | 449 | ||
450 | union svc_pktinfo_u { | 450 | union svc_pktinfo_u { |
451 | struct in_pktinfo pkti; | 451 | struct in_pktinfo pkti; |
452 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
453 | struct in6_pktinfo pkti6; | 452 | struct in6_pktinfo pkti6; |
454 | #endif | ||
455 | }; | 453 | }; |
456 | 454 | ||
457 | static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh) | 455 | static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh) |
@@ -467,7 +465,7 @@ static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh) | |||
467 | cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); | 465 | cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); |
468 | } | 466 | } |
469 | break; | 467 | break; |
470 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 468 | |
471 | case AF_INET6: { | 469 | case AF_INET6: { |
472 | struct in6_pktinfo *pki = CMSG_DATA(cmh); | 470 | struct in6_pktinfo *pki = CMSG_DATA(cmh); |
473 | 471 | ||
@@ -479,7 +477,6 @@ static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh) | |||
479 | cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); | 477 | cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); |
480 | } | 478 | } |
481 | break; | 479 | break; |
482 | #endif | ||
483 | } | 480 | } |
484 | return; | 481 | return; |
485 | } | 482 | } |
@@ -730,13 +727,11 @@ static inline void svc_udp_get_dest_address(struct svc_rqst *rqstp, | |||
730 | rqstp->rq_daddr.addr.s_addr = pki->ipi_spec_dst.s_addr; | 727 | rqstp->rq_daddr.addr.s_addr = pki->ipi_spec_dst.s_addr; |
731 | break; | 728 | break; |
732 | } | 729 | } |
733 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
734 | case AF_INET6: { | 730 | case AF_INET6: { |
735 | struct in6_pktinfo *pki = CMSG_DATA(cmh); | 731 | struct in6_pktinfo *pki = CMSG_DATA(cmh); |
736 | ipv6_addr_copy(&rqstp->rq_daddr.addr6, &pki->ipi6_addr); | 732 | ipv6_addr_copy(&rqstp->rq_daddr.addr6, &pki->ipi6_addr); |
737 | break; | 733 | break; |
738 | } | 734 | } |
739 | #endif | ||
740 | } | 735 | } |
741 | } | 736 | } |
742 | 737 | ||
@@ -985,11 +980,9 @@ static inline int svc_port_is_privileged(struct sockaddr *sin) | |||
985 | case AF_INET: | 980 | case AF_INET: |
986 | return ntohs(((struct sockaddr_in *)sin)->sin_port) | 981 | return ntohs(((struct sockaddr_in *)sin)->sin_port) |
987 | < PROT_SOCK; | 982 | < PROT_SOCK; |
988 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
989 | case AF_INET6: | 983 | case AF_INET6: |
990 | return ntohs(((struct sockaddr_in6 *)sin)->sin6_port) | 984 | return ntohs(((struct sockaddr_in6 *)sin)->sin6_port) |
991 | < PROT_SOCK; | 985 | < PROT_SOCK; |
992 | #endif | ||
993 | default: | 986 | default: |
994 | return 0; | 987 | return 0; |
995 | } | 988 | } |