summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2001-04-08 19:21:50 +0000
committeriedowse <iedowse@FreeBSD.org>2001-04-08 19:21:50 +0000
commit1c1ece43e36a378d5f28a97aeb58508b88cb44a3 (patch)
tree47630fab01a688d94109b182a9e2bd68be5bbceb /lib
parent494867e77f0e87497e54df1a9fb5510da9b80f58 (diff)
downloadFreeBSD-src-1c1ece43e36a378d5f28a97aeb58508b88cb44a3.zip
FreeBSD-src-1c1ece43e36a378d5f28a97aeb58508b88cb44a3.tar.gz
The maximum RPC message size was set at 8k for UDP. This is lower
than the default buffer size in the old RPC code (8800 bytes), and it could not be overriden by the application. This caused problems with CFS (/usr/port/security/cfs). Change this default back to UDPMSGSIZE (8800 bytes), but more importantly, allow applications to use larger message sizes for all protocols if desired. Choose an arbitrary maximum message size of 256k instead of using the default as the maximum (which is silly). Reported by: ache Reviewed by: alfred, Martin Blapp <mb@imp.ch>
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/rpc/rpc_generic.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libc/rpc/rpc_generic.c b/lib/libc/rpc/rpc_generic.c
index 3275568..7b00d2c 100644
--- a/lib/libc/rpc/rpc_generic.c
+++ b/lib/libc/rpc/rpc_generic.c
@@ -137,21 +137,22 @@ __rpc_get_t_size(af, proto, size)
int af, proto;
int size; /* Size requested */
{
- int maxsize;
+ int maxsize, defsize;
+ maxsize = 256 * 1024; /* XXX */
switch (proto) {
case IPPROTO_TCP:
- maxsize = 65536; /* XXX */
+ defsize = 64 * 1024; /* XXX */
break;
case IPPROTO_UDP:
- maxsize = 8192; /* XXX */
+ defsize = UDPMSGSIZE;
break;
default:
- maxsize = RPC_MAXDATASIZE;
+ defsize = RPC_MAXDATASIZE;
break;
}
if (size == 0)
- return maxsize;
+ return defsize;
/* Check whether the value is within the upper max limit */
return (size > maxsize ? (u_int)maxsize : (u_int)size);
OpenPOWER on IntegriCloud