diff options
-rw-r--r-- | include/linux/sunrpc/svc.h | 2 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 13 |
2 files changed, 3 insertions, 12 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 83b3c7b433aa..35fa4d5aadd0 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -194,9 +194,7 @@ static inline void svc_putu32(struct kvec *iov, __be32 val) | |||
194 | 194 | ||
195 | union svc_addr_u { | 195 | union svc_addr_u { |
196 | struct in_addr addr; | 196 | struct in_addr addr; |
197 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
198 | struct in6_addr addr6; | 197 | struct in6_addr addr6; |
199 | #endif | ||
200 | }; | 198 | }; |
201 | 199 | ||
202 | /* | 200 | /* |
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 | } |