aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2009-03-18 20:46:44 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-03-28 15:55:18 -0400
commit7d21c0f9845f0ce4e81baac3519fbb2c6c2cc908 (patch)
tree8e4eefa86dfc05bfc0f36452863f55c570c82456 /net
parent26298caacac3e4754194b13aef377706d5de6cf6 (diff)
SUNRPC: Set IPV6ONLY flag on PF_INET6 RPC listener sockets
We are about to convert to using separate RPC listener sockets for PF_INET and PF_INET6. This echoes the way IPv6 is handled in user space by TI-RPC, and eliminates the need for ULPs to worry about mapped IPv4 AF_INET6 addresses when doing address comparisons. Start by setting the IPV6ONLY flag on PF_INET6 RPC listener sockets. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svcsock.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index d00bc3307745..ac6cd65220c7 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1144,13 +1144,11 @@ static struct svc_sock *svc_setup_socket(struct svc_serv *serv,
1144 svc_tcp_init(svsk, serv); 1144 svc_tcp_init(svsk, serv);
1145 1145
1146 /* 1146 /*
1147 * We start one listener per sv_serv. We want AF_INET 1147 * If this is a PF_INET6 listener, we want to avoid
1148 * requests to be automatically shunted to our PF_INET6 1148 * getting requests from IPv4 remotes. Those should
1149 * listener using a mapped IPv4 address. Make sure 1149 * be shunted to a PF_INET listener via rpcbind.
1150 * no-one starts an equivalent IPv4 listener, which
1151 * would steal our incoming connections.
1152 */ 1150 */
1153 val = 0; 1151 val = 1;
1154 if (inet->sk_family == PF_INET6) 1152 if (inet->sk_family == PF_INET6)
1155 kernel_setsockopt(sock, SOL_IPV6, IPV6_V6ONLY, 1153 kernel_setsockopt(sock, SOL_IPV6, IPV6_V6ONLY,
1156 (char *)&val, sizeof(val)); 1154 (char *)&val, sizeof(val));