NSM: Fix unaligned accesses in nsm_init_private()
[deliverable/linux.git] / net / sunrpc / svcsock.c
index 5763e6460feac2535429bd97b7f9e43b36816cd9..ac6cd65220c7dc2a0c8c4112d46a29c056530b89 100644 (file)
@@ -1122,7 +1122,7 @@ static struct svc_sock *svc_setup_socket(struct svc_serv *serv,
 
        /* Register socket with portmapper */
        if (*errp >= 0 && pmap_register)
-               *errp = svc_register(serv, inet->sk_protocol,
+               *errp = svc_register(serv, inet->sk_family, inet->sk_protocol,
                                     ntohs(inet_sk(inet)->sport));
 
        if (*errp < 0) {
@@ -1144,14 +1144,12 @@ static struct svc_sock *svc_setup_socket(struct svc_serv *serv,
                svc_tcp_init(svsk, serv);
 
        /*
-        * We start one listener per sv_serv.  We want AF_INET
-        * requests to be automatically shunted to our AF_INET6
-        * listener using a mapped IPv4 address.  Make sure
-        * no-one starts an equivalent IPv4 listener, which
-        * would steal our incoming connections.
+        * If this is a PF_INET6 listener, we want to avoid
+        * getting requests from IPv4 remotes.  Those should
+        * be shunted to a PF_INET listener via rpcbind.
         */
-       val = 0;
-       if (serv->sv_family == AF_INET6)
+       val = 1;
+       if (inet->sk_family == PF_INET6)
                kernel_setsockopt(sock, SOL_IPV6, IPV6_V6ONLY,
                                        (char *)&val, sizeof(val));
 
This page took 0.02443 seconds and 5 git commands to generate.