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>
This commit is contained in:
Ian Dowse 2001-04-08 19:21:50 +00:00
parent 92020f7a8c
commit e14f19f42a

View File

@ -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);