summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_vfsops.c
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1997-04-22 17:38:01 +0000
committerdfr <dfr@FreeBSD.org>1997-04-22 17:38:01 +0000
commit5a956ea098ef7e4fa34e7c350250c3b0a1919b4f (patch)
tree85ac37647fa6da547b4cb5bdab4e7cd51dcf8f22 /sys/nfsclient/nfs_vfsops.c
parent7f078631641bbf1b5e5cb26bddb5c17e5aa8e7be (diff)
downloadFreeBSD-src-5a956ea098ef7e4fa34e7c350250c3b0a1919b4f.zip
FreeBSD-src-5a956ea098ef7e4fa34e7c350250c3b0a1919b4f.tar.gz
Fix broken usage of nm_readdirsize and increase the socket buffers for UDP
to prevent possible socket overflows. 2.2 candidate. PR: kern/3304 Reviewed by: Thomas David Rivers <ponds!rivers@dg-rtp.dg.com>
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r--sys/nfsclient/nfs_vfsops.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 84963cf..aee1ca2 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
- * $Id: nfs_vfsops.c,v 1.36 1997/03/24 11:33:39 bde Exp $
+ * $Id: nfs_vfsops.c,v 1.37 1997/04/04 17:49:30 dfr Exp $
*/
#include <sys/param.h>
@@ -302,12 +302,9 @@ nfs_fsinfo(nmp, vp, cred, p)
}
pref = fxdr_unsigned(u_long, fsp->fs_dtpref);
if (pref < nmp->nm_readdirsize)
- nmp->nm_readdirsize = (pref + NFS_DIRBLKSIZ - 1) &
- ~(NFS_DIRBLKSIZ - 1);
+ nmp->nm_readdirsize = pref;
if (max < nmp->nm_readdirsize) {
- nmp->nm_readdirsize = max & ~(NFS_DIRBLKSIZ - 1);
- if (nmp->nm_readdirsize == 0)
- nmp->nm_readdirsize = max;
+ nmp->nm_readdirsize = max;
}
nmp->nm_flag |= NFSMNT_GOTFSINFO;
}
@@ -741,13 +738,11 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
if ((argp->flags & NFSMNT_READDIRSIZE) && argp->readdirsize > 0) {
nmp->nm_readdirsize = argp->readdirsize;
- /* Round down to multiple of blocksize */
- nmp->nm_readdirsize &= ~(NFS_DIRBLKSIZ - 1);
- if (nmp->nm_readdirsize < NFS_DIRBLKSIZ)
- nmp->nm_readdirsize = NFS_DIRBLKSIZ;
}
if (nmp->nm_readdirsize > maxio)
nmp->nm_readdirsize = maxio;
+ if (nmp->nm_readdirsize > nmp->nm_rsize)
+ nmp->nm_readdirsize = nmp->nm_rsize;
if ((argp->flags & NFSMNT_MAXGRPS) && argp->maxgrouplist >= 0 &&
argp->maxgrouplist <= NFS_MAXGRPS)
OpenPOWER on IntegriCloud