And this is the server part. Please note that it is neccessary to include rpc_com.h here since we cannot add this include "rpc/rpc_com.h" in svc.h directly cause we break then the library itself and get conflicts for __svc_maxrec and __svc_xports. Index: contrib/amd/conf/transp/transp_sockets.c =================================================================== RCS file: /usr/home/ncvs/src/contrib/amd/conf/transp/transp_sockets.c,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 transp_sockets.c --- contrib/amd/conf/transp/transp_sockets.c 2 Sep 2001 17:19:03 -0000 1.1.1.4 +++ contrib/amd/conf/transp/transp_sockets.c 11 Jan 2003 21:35:58 -0000 @@ -50,6 +50,9 @@ #include #include +#ifndef RPC_MAXDATASIZE +#define RPC_MAXDATASIZE 9000 +#endif /* * find the IP address that can be used to connect to the local host @@ -216,6 +219,8 @@ int create_amq_service(int *udp_soAMQp, SVCXPRT **udp_amqpp, int *tcp_soAMQp, SVCXPRT **tcp_amqpp) { + int maxrec = RPC_MAXDATASIZE; + /* first create TCP service */ if (tcp_soAMQp) { *tcp_soAMQp = socket(AF_INET, SOCK_STREAM, 0); @@ -231,6 +236,9 @@ return 2; } } +#ifdef SVCSET_CONNMAXREC + SVC_CONTROL(*tcp_amqpp, SVCSET_CONNMAXREC, &maxrec); +#endif /* next create UDP service */ if (udp_soAMQp) { Index: usr.sbin/mountd/mountd.c =================================================================== RCS file: /usr/home/ncvs/src/usr.sbin/mountd/mountd.c,v retrieving revision 1.70 diff -u -r1.70 mountd.c --- usr.sbin/mountd/mountd.c 16 Oct 2002 16:04:50 -0000 1.70 +++ usr.sbin/mountd/mountd.c 11 Jan 2003 21:37:52 -0000 @@ -59,6 +59,7 @@ #include #include +#include #include #include #include @@ -273,6 +274,7 @@ struct netconfig *udpconf, *tcpconf, *udp6conf, *tcp6conf; int udpsock, tcpsock, udp6sock, tcp6sock; int xcreated = 0, s; + int maxrec = RPC_MAXDATASIZE; int one = 1; int c; @@ -354,6 +356,9 @@ tcpsock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); udpconf = getnetconfigent("udp"); tcpconf = getnetconfigent("tcp"); + + rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec); + if (!have_v6) goto skip_v6; udp6sock = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); @@ -408,7 +413,7 @@ if (tcpsock != -1 && tcpconf != NULL) { bindresvport(tcpsock, NULL); listen(tcpsock, SOMAXCONN); - tcptransp = svc_vc_create(tcpsock, 0, 0); + tcptransp = svc_vc_create(tcpsock, RPC_MAXDATASIZE, RPC_MAXDATASIZE); if (tcptransp != NULL) { if (!svc_reg(tcptransp, RPCPROG_MNT, RPCMNT_VER1, mntsrv, tcpconf)) @@ -449,7 +454,7 @@ if (have_v6 && tcp6sock != -1 && tcp6conf != NULL) { bindresvport(tcp6sock, NULL); listen(tcp6sock, SOMAXCONN); - tcp6transp = svc_vc_create(tcp6sock, 0, 0); + tcp6transp = svc_vc_create(tcp6sock, RPC_MAXDATASIZE, RPC_MAXDATASIZE); if (tcp6transp != NULL) { if (!svc_reg(tcp6transp, RPCPROG_MNT, RPCMNT_VER1, mntsrv, tcp6conf)) Index: usr.sbin/rpc.lockd/lockd.c =================================================================== RCS file: /usr/home/ncvs/src/usr.sbin/rpc.lockd/lockd.c,v retrieving revision 1.13 diff -u -r1.13 lockd.c --- usr.sbin/rpc.lockd/lockd.c 11 Apr 2002 07:19:30 -0000 1.13 +++ usr.sbin/rpc.lockd/lockd.c 11 Jan 2003 21:37:06 -0000 @@ -61,6 +61,7 @@ #include #include +#include #include #include "lockd.h" @@ -95,6 +96,7 @@ struct sigaction sigalarm; int grace_period = 30; struct netconfig *nconf; + int maxrec = RPC_MAXDATASIZE; while ((ch = getopt(argc, argv, "d:g:")) != (-1)) { switch (ch) { @@ -139,13 +141,16 @@ maxindex = 4; } + rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec); + for (i = 0; i < maxindex; i++) { nconf = getnetconfigent(transports[i]); if (nconf == NULL) errx(1, "cannot get %s netconf: %s.", transports[i], nc_sperror()); - transp = svc_tli_create(RPC_ANYFD, nconf, NULL, 0, 0); + transp = svc_tli_create(RPC_ANYFD, nconf, NULL, + RPC_MAXDATASIZE, RPC_MAXDATASIZE); if (transp == NULL) { errx(1, "cannot create %s service.", transports[i]); /* NOTREACHED */ Index: usr.sbin/rpc.statd/statd.c =================================================================== RCS file: /usr/home/ncvs/src/usr.sbin/rpc.statd/statd.c,v retrieving revision 1.10 diff -u -r1.10 statd.c --- usr.sbin/rpc.statd/statd.c 15 Jul 2002 19:00:34 -0000 1.10 +++ usr.sbin/rpc.statd/statd.c 11 Jan 2003 21:38:21 -0000 @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,7 @@ main(int argc, char **argv) { struct sigaction sa; + int maxrec = RPC_MAXDATASIZE; if (argc > 1) { @@ -70,6 +72,8 @@ } (void)rpcb_unset(SM_PROG, SM_VERS, NULL); + + rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec); if (!svc_create(sm_prog_1, SM_PROG, SM_VERS, "udp")) errx(1, "cannot create udp service"); Index: usr.sbin/rpc.yppasswdd/yppasswdd_main.c =================================================================== RCS file: /usr/home/ncvs/src/usr.sbin/rpc.yppasswdd/yppasswdd_main.c,v retrieving revision 1.22 diff -u -r1.22 yppasswdd_main.c --- usr.sbin/rpc.yppasswdd/yppasswdd_main.c 11 May 2002 04:10:49 -0000 1.22 +++ usr.sbin/rpc.yppasswdd/yppasswdd_main.c 11 Jan 2003 22:30:24 -0000 @@ -56,6 +56,7 @@ #include #include +#include #include /* for pmap_unset */ #include struct dom_binding {}; @@ -171,6 +172,7 @@ int ch; char *mastername; char myname[MAXHOSTNAMELEN + 2]; + int maxrec = RPC_MAXDATASIZE; extern int debug; @@ -272,6 +274,8 @@ rpcb_unset(YPPASSWDPROG, YPPASSWDVERS, NULL); rpcb_unset(MASTER_YPPASSWDPROG, MASTER_YPPASSWDVERS, NULL); + + rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec); if (svc_create(yppasswdprog_1, YPPASSWDPROG, YPPASSWDVERS, "netpath") == 0) { yp_error("cannot create yppasswd service."); Index: usr.sbin/rpcbind/rpcb_svc_com.c =================================================================== RCS file: /usr/home/ncvs/src/usr.sbin/rpcbind/rpcb_svc_com.c,v retrieving revision 1.9 diff -u -r1.9 rpcb_svc_com.c --- usr.sbin/rpcbind/rpcb_svc_com.c 1 Jan 2003 18:49:03 -0000 1.9 +++ usr.sbin/rpcbind/rpcb_svc_com.c 11 Jan 2003 21:35:59 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: rpcb_svc_com.c,v 1.6 2000/08/03 00:07:22 fvdl Exp $ */ +/* $NetBSD: rpcb_svc_com.c,v 1.9 2002/11/08 00:16:39 fvdl Exp $ */ /* $FreeBSD: src/usr.sbin/rpcbind/rpcb_svc_com.c,v 1.9 2003/01/01 18:49:03 schweikh Exp $ */ /* @@ -1073,6 +1073,7 @@ #define MASKVAL (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND) +extern bool_t __svc_clean_idle(fd_set *, int, bool_t); void my_svc_run() @@ -1085,6 +1086,7 @@ int i; #endif register struct pollfd *p; + fd_set cleanfds; for (;;) { p = pollfds; @@ -1106,7 +1108,7 @@ fprintf(stderr, ">\n"); } #endif - switch (poll_ret = poll(pollfds, nfds, INFTIM)) { + switch (poll_ret = poll(pollfds, nfds, 30 * 1000)) { case -1: /* * We ignore all errors, continuing with the assumption @@ -1114,6 +1116,8 @@ * other outside event) and not caused by poll(). */ case 0: + cleanfds = svc_fdset; + __svc_clean_idle(&cleanfds, 30, FALSE); continue; default: #ifdef SVC_RUN_DEBUG Index: usr.sbin/rpcbind/rpcbind.c =================================================================== RCS file: /usr/home/ncvs/src/usr.sbin/rpcbind/rpcbind.c,v retrieving revision 1.10 diff -u -r1.10 rpcbind.c --- usr.sbin/rpcbind/rpcbind.c 1 Jan 2003 18:49:03 -0000 1.10 +++ usr.sbin/rpcbind/rpcbind.c 11 Jan 2003 21:36:17 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD: rpcbind.c,v 1.1 2000/06/02 23:15:42 fvdl Exp $ */ +/* $NetBSD: rpcbind.c,v 1.3 2002/11/08 00:16:40 fvdl Exp $ */ /* $FreeBSD: src/usr.sbin/rpcbind/rpcbind.c,v 1.10 2003/01/01 18:49:03 schweikh Exp $ */ /* @@ -57,6 +57,7 @@ #include #include #include +#include #ifdef PORTMAP #include #endif @@ -124,6 +125,7 @@ struct netconfig *nconf; void *nc_handle; /* Net config handle */ struct rlimit rl; + int maxrec = RPC_MAXDATASIZE; parseargs(argc, argv); @@ -165,6 +167,9 @@ syslog(LOG_ERR, "%s: can't find local transport\n", argv[0]); exit(1); } + + rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec); + init_transport(nconf); while ((nconf = getnetconfig(nc_handle))) { @@ -431,7 +436,7 @@ listen(fd, SOMAXCONN); my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr, - 0, 0); + RPC_MAXDATASIZE, RPC_MAXDATASIZE); if (my_xprt == (SVCXPRT *)NULL) { syslog(LOG_ERR, "%s: could not create service", nconf->nc_netid); @@ -491,7 +496,7 @@ if (nconf->nc_semantics != NC_TPI_CLTS) listen(fd, SOMAXCONN); - my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr, 0, 0); + my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr, RPC_MAXDATASIZE, RPC_MAXDATASIZE); if (my_xprt == (SVCXPRT *)NULL) { syslog(LOG_ERR, "%s: could not create service", nconf->nc_netid);