summaryrefslogtreecommitdiffstats
path: root/sys/rpc/rpc_generic.c
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2010-10-13 00:57:14 +0000
committerrmacklem <rmacklem@FreeBSD.org>2010-10-13 00:57:14 +0000
commit8c097aa69ed7151df0358afc55a9bec6e7ae8b1a (patch)
tree27afd686162b8fae8b69fbe564fda358ccb1a1c0 /sys/rpc/rpc_generic.c
parenteb994eb349fb4a02d6fb78be086b538e11eafd52 (diff)
downloadFreeBSD-src-8c097aa69ed7151df0358afc55a9bec6e7ae8b1a.zip
FreeBSD-src-8c097aa69ed7151df0358afc55a9bec6e7ae8b1a.tar.gz
Fix the krpc so that it can handle NFSv3,UDP mounts with a read/write
data size greater than 8192. Since soreserve(so, 256*1024, 256*1024) would always fail for the default value of sb_max, modify clnt_dg.c so that it uses the calculated values and checks for an error return from soreserve(). Also, add a check for error return from soreserve() to clnt_vc.c and change __rpc_get_t_size() to use sb_max_adj instead of the bogus maxsize == 256*1024. PR: kern/150910 Reviewed by: jhb MFC after: 2 weeks
Diffstat (limited to 'sys/rpc/rpc_generic.c')
-rw-r--r--sys/rpc/rpc_generic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/rpc/rpc_generic.c b/sys/rpc/rpc_generic.c
index efc0cb0..1c6aa82 100644
--- a/sys/rpc/rpc_generic.c
+++ b/sys/rpc/rpc_generic.c
@@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$");
#include <rpc/rpc_com.h>
+extern u_long sb_max_adj; /* not defined in socketvar.h */
+
#if __FreeBSD_version < 700000
#define strrchr rindex
#endif
@@ -113,9 +115,8 @@ u_int
/*ARGSUSED*/
__rpc_get_t_size(int af, int proto, int size)
{
- int maxsize, defsize;
+ int defsize;
- maxsize = 256 * 1024; /* XXX */
switch (proto) {
case IPPROTO_TCP:
defsize = 64 * 1024; /* XXX */
@@ -131,7 +132,7 @@ __rpc_get_t_size(int af, int proto, int size)
return defsize;
/* Check whether the value is within the upper max limit */
- return (size > maxsize ? (u_int)maxsize : (u_int)size);
+ return (size > sb_max_adj ? (u_int)sb_max_adj : (u_int)size);
}
/*
OpenPOWER on IntegriCloud