Commit 5a05ed73 authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds

[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: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7a37f578
...@@ -194,9 +194,7 @@ static inline void svc_putu32(struct kvec *iov, __be32 val) ...@@ -194,9 +194,7 @@ static inline void svc_putu32(struct kvec *iov, __be32 val)
union svc_addr_u { union svc_addr_u {
struct in_addr addr; struct in_addr addr;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct in6_addr addr6; struct in6_addr addr6;
#endif
}; };
/* /*
......
...@@ -131,13 +131,13 @@ static char *__svc_print_addr(struct sockaddr *addr, char *buf, size_t len) ...@@ -131,13 +131,13 @@ static char *__svc_print_addr(struct sockaddr *addr, char *buf, size_t len)
NIPQUAD(((struct sockaddr_in *) addr)->sin_addr), NIPQUAD(((struct sockaddr_in *) addr)->sin_addr),
htons(((struct sockaddr_in *) addr)->sin_port)); htons(((struct sockaddr_in *) addr)->sin_port));
break; break;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case AF_INET6: case AF_INET6:
snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u",
NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), NIP6(((struct sockaddr_in6 *) addr)->sin6_addr),
htons(((struct sockaddr_in6 *) addr)->sin6_port)); htons(((struct sockaddr_in6 *) addr)->sin6_port));
break; break;
#endif
default: default:
snprintf(buf, len, "unknown address type: %d", addr->sa_family); snprintf(buf, len, "unknown address type: %d", addr->sa_family);
break; break;
...@@ -449,9 +449,7 @@ svc_wake_up(struct svc_serv *serv) ...@@ -449,9 +449,7 @@ svc_wake_up(struct svc_serv *serv)
union svc_pktinfo_u { union svc_pktinfo_u {
struct in_pktinfo pkti; struct in_pktinfo pkti;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
struct in6_pktinfo pkti6; struct in6_pktinfo pkti6;
#endif
}; };
static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh) 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,7 +465,7 @@ static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh)
cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); cmh->cmsg_len = CMSG_LEN(sizeof(*pki));
} }
break; break;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case AF_INET6: { case AF_INET6: {
struct in6_pktinfo *pki = CMSG_DATA(cmh); struct in6_pktinfo *pki = CMSG_DATA(cmh);
...@@ -479,7 +477,6 @@ static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh) ...@@ -479,7 +477,6 @@ static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh)
cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); cmh->cmsg_len = CMSG_LEN(sizeof(*pki));
} }
break; break;
#endif
} }
return; return;
} }
...@@ -730,13 +727,11 @@ static inline void svc_udp_get_dest_address(struct svc_rqst *rqstp, ...@@ -730,13 +727,11 @@ static inline void svc_udp_get_dest_address(struct svc_rqst *rqstp,
rqstp->rq_daddr.addr.s_addr = pki->ipi_spec_dst.s_addr; rqstp->rq_daddr.addr.s_addr = pki->ipi_spec_dst.s_addr;
break; break;
} }
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case AF_INET6: { case AF_INET6: {
struct in6_pktinfo *pki = CMSG_DATA(cmh); struct in6_pktinfo *pki = CMSG_DATA(cmh);
ipv6_addr_copy(&rqstp->rq_daddr.addr6, &pki->ipi6_addr); ipv6_addr_copy(&rqstp->rq_daddr.addr6, &pki->ipi6_addr);
break; break;
} }
#endif
} }
} }
...@@ -985,11 +980,9 @@ static inline int svc_port_is_privileged(struct sockaddr *sin) ...@@ -985,11 +980,9 @@ static inline int svc_port_is_privileged(struct sockaddr *sin)
case AF_INET: case AF_INET:
return ntohs(((struct sockaddr_in *)sin)->sin_port) return ntohs(((struct sockaddr_in *)sin)->sin_port)
< PROT_SOCK; < PROT_SOCK;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case AF_INET6: case AF_INET6:
return ntohs(((struct sockaddr_in6 *)sin)->sin6_port) return ntohs(((struct sockaddr_in6 *)sin)->sin6_port)
< PROT_SOCK; < PROT_SOCK;
#endif
default: default:
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment