summaryrefslogtreecommitdiffstats
path: root/sys/rpc/clnt_vc.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/clnt_vc.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/clnt_vc.c')
-rw-r--r--sys/rpc/clnt_vc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c
index 2e5fe41..9699a8d 100644
--- a/sys/rpc/clnt_vc.c
+++ b/sys/rpc/clnt_vc.c
@@ -288,13 +288,19 @@ clnt_vc_create(
* Create a client handle which uses xdrrec for serialization
* and authnone for authentication.
*/
+ sendsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)sendsz);
+ recvsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsz);
+ error = soreserve(ct->ct_socket, sendsz, recvsz);
+ if (error != 0) {
+ if (ct->ct_closeit) {
+ soclose(ct->ct_socket);
+ }
+ goto err;
+ }
cl->cl_refs = 1;
cl->cl_ops = &clnt_vc_ops;
cl->cl_private = ct;
cl->cl_auth = authnone_create();
- sendsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)sendsz);
- recvsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsz);
- soreserve(ct->ct_socket, sendsz, recvsz);
SOCKBUF_LOCK(&ct->ct_socket->so_rcv);
soupcall_set(ct->ct_socket, SO_RCV, clnt_vc_soupcall, ct);
OpenPOWER on IntegriCloud