nfsd: copy client's address including port number to cl_addr
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 15 May 2019 01:38:11 +0000 (21:38 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 3 Jul 2019 21:52:50 +0000 (17:52 -0400)
rpc_copy_addr() copies only the IP address and misses any port numbers.
It seems potentially useful to keep the port number around too.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c

index a6c722dc7e5e66394511926eb599f45469a66c7f..c2cbf14e010d3aa8a563fde461c6b49c85215ece 100644 (file)
@@ -2273,7 +2273,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name,
        clp->cl_time = get_seconds();
        clear_bit(0, &clp->cl_cb_slot_busy);
        copy_verf(clp, verf);
-       rpc_copy_addr((struct sockaddr *) &clp->cl_addr, sa);
+       memcpy(&clp->cl_addr, sa, sizeof(struct sockaddr_storage));
        clp->cl_cb_session = NULL;
        clp->net = net;
        clp->cl_nfsd_dentry = nfsd_client_mkdir(nn, &clp->cl_nfsdfs,