NFSD: Support AF_INET6 in svc_addsock() function
authorAime Le Rouzic <aime.le-rouzic@bull.net>
Tue, 26 Jan 2010 19:03:56 +0000 (14:03 -0500)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Tue, 26 Jan 2010 22:55:56 +0000 (17:55 -0500)
Relax the address family check at the top of svc_addsock() to allow AF_INET6
listener sockets to be specified via /proc/fs/nfsd/portlist.

Signed-off-by: Aime Le Rouzic <aime.le-rouzic@bull.net>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
net/sunrpc/svcsock.c

index 870929e08e5de7463b77c7b760afe43e3c382888..9e093910c479ef02df3da92353962039828e340a 100644 (file)
@@ -1357,7 +1357,7 @@ int svc_addsock(struct svc_serv *serv, const int fd, char *name_return,
 
        if (!so)
                return err;
-       if (so->sk->sk_family != AF_INET)
+       if ((so->sk->sk_family != PF_INET) && (so->sk->sk_family != PF_INET6))
                err =  -EAFNOSUPPORT;
        else if (so->sk->sk_protocol != IPPROTO_TCP &&
            so->sk->sk_protocol != IPPROTO_UDP)