diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2009-03-18 20:46:13 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-03-28 15:54:23 -0400 |
commit | baf01caf09e87579c2d157e5ee29975db8551522 (patch) | |
tree | e7ab4f9eb5b8c2d158a2a330e935cfd8be9e356a /net/sunrpc/svcsock.c | |
parent | 4b62e58cccff9c5e7ffc7023f7ec24c75fbd549b (diff) |
SUNRPC: svc_setup_socket() gets protocol family from socket
Since the sv_family field is going away, modify svc_setup_socket() to
extract the protocol family from the passed-in socket instead of from
the passed-in svc_serv struct.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r-- | net/sunrpc/svcsock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index d00583c1cd04..d00bc3307745 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -1122,7 +1122,7 @@ static struct svc_sock *svc_setup_socket(struct svc_serv *serv, | |||
1122 | 1122 | ||
1123 | /* Register socket with portmapper */ | 1123 | /* Register socket with portmapper */ |
1124 | if (*errp >= 0 && pmap_register) | 1124 | if (*errp >= 0 && pmap_register) |
1125 | *errp = svc_register(serv, serv->sv_family, inet->sk_protocol, | 1125 | *errp = svc_register(serv, inet->sk_family, inet->sk_protocol, |
1126 | ntohs(inet_sk(inet)->sport)); | 1126 | ntohs(inet_sk(inet)->sport)); |
1127 | 1127 | ||
1128 | if (*errp < 0) { | 1128 | if (*errp < 0) { |
@@ -1145,13 +1145,13 @@ static struct svc_sock *svc_setup_socket(struct svc_serv *serv, | |||
1145 | 1145 | ||
1146 | /* | 1146 | /* |
1147 | * We start one listener per sv_serv. We want AF_INET | 1147 | * We start one listener per sv_serv. We want AF_INET |
1148 | * requests to be automatically shunted to our AF_INET6 | 1148 | * requests to be automatically shunted to our PF_INET6 |
1149 | * listener using a mapped IPv4 address. Make sure | 1149 | * listener using a mapped IPv4 address. Make sure |
1150 | * no-one starts an equivalent IPv4 listener, which | 1150 | * no-one starts an equivalent IPv4 listener, which |
1151 | * would steal our incoming connections. | 1151 | * would steal our incoming connections. |
1152 | */ | 1152 | */ |
1153 | val = 0; | 1153 | val = 0; |
1154 | if (serv->sv_family == AF_INET6) | 1154 | if (inet->sk_family == PF_INET6) |
1155 | kernel_setsockopt(sock, SOL_IPV6, IPV6_V6ONLY, | 1155 | kernel_setsockopt(sock, SOL_IPV6, IPV6_V6ONLY, |
1156 | (char *)&val, sizeof(val)); | 1156 | (char *)&val, sizeof(val)); |
1157 | 1157 | ||