Date: Thu, 9 Nov 2017 11:47:47 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r325575 - projects/pnfs-planb-server-stable11/sys/fs/nfsserver Message-ID: <201711091147.vA9BllQ9045597@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Thu Nov 9 11:47:47 2017 New Revision: 325575 URL: https://svnweb.freebsd.org/changeset/base/325575 Log: Add the recent commit to stable/11 (r325341) that fixes dumping of addresses for 64bit and NFSv4.1. Modified: projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdserv.c projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdstate.c Modified: projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdserv.c Thu Nov 9 11:45:59 2017 (r325574) +++ projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdserv.c Thu Nov 9 11:47:47 2017 (r325575) @@ -3927,6 +3927,7 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused uint32_t sp4type, v41flags; uint64_t owner_minor; struct timespec verstime; + struct sockaddr_in *sad, *rad; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; @@ -3950,6 +3951,13 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused NFSINITSOCKMUTEX(&clp->lc_req.nr_mtx); NFSSOCKADDRALLOC(clp->lc_req.nr_nam); NFSSOCKADDRSIZE(clp->lc_req.nr_nam, sizeof (struct sockaddr_in)); + sad = NFSSOCKADDR(nd->nd_nam, struct sockaddr_in *); + rad = NFSSOCKADDR(clp->lc_req.nr_nam, struct sockaddr_in *); + rad->sin_family = AF_INET; + rad->sin_addr.s_addr = 0; + rad->sin_port = 0; + if (sad->sin_family == AF_INET) + rad->sin_addr.s_addr = sad->sin_addr.s_addr; clp->lc_req.nr_cred = NULL; NFSBCOPY(verf, clp->lc_verf, NFSX_VERF); clp->lc_idlen = idlen; Modified: projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdstate.c Thu Nov 9 11:45:59 2017 (r325574) +++ projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdstate.c Thu Nov 9 11:47:47 2017 (r325575) @@ -3946,11 +3946,11 @@ nfsrv_getclientipaddr(struct nfsrv_descript *nd, struc u_char protocol[5], addr[24]; int error = 0, cantparse = 0; union { - u_long ival; + in_addr_t ival; u_char cval[4]; } ip; union { - u_short sval; + in_port_t sval; u_char cval[2]; } port; @@ -4044,8 +4044,10 @@ nfsrv_getclientipaddr(struct nfsrv_descript *nd, struc } if (cantparse) { sad = NFSSOCKADDR(nd->nd_nam, struct sockaddr_in *); - rad->sin_addr.s_addr = sad->sin_addr.s_addr; - rad->sin_port = 0x0; + if (sad->sin_family == AF_INET) { + rad->sin_addr.s_addr = sad->sin_addr.s_addr; + rad->sin_port = 0x0; + } clp->lc_program = 0; } nfsmout:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711091147.vA9BllQ9045597>