diff options
author | fenner <fenner@FreeBSD.org> | 1996-10-28 23:26:37 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 1996-10-28 23:26:37 +0000 |
commit | 6a0fb85f4754bfc12c9e49202548159489701554 (patch) | |
tree | 7ca3f7c60fc473f6d2c5942e9df23b52f637ef4c /sbin | |
parent | e9e54bcde4c77ac5866b3bb5a79e93ed3c103d6c (diff) | |
download | FreeBSD-src-6a0fb85f4754bfc12c9e49202548159489701554.zip FreeBSD-src-6a0fb85f4754bfc12c9e49202548159489701554.tar.gz |
If rcmd() fails, return immediately instead of trying a bunch of
setsockopt()'s on a -1 file descriptor.
Remove attempt to decrease TCP MSS; it makes no sense.
Set the IP TOS to IPTOS_THROUGHPUT as an indication that this is an
application sending large blocks of data, as recommended by RFC1700.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dump/dumprmt.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sbin/dump/dumprmt.c b/sbin/dump/dumprmt.c index 48d07d4..643e561 100644 --- a/sbin/dump/dumprmt.c +++ b/sbin/dump/dumprmt.c @@ -49,7 +49,8 @@ static char sccsid[] = "@(#)dumprmt.c 8.1 (Berkeley) 6/5/93"; #endif #include <netinet/in.h> -#include <netinet/tcp.h> +#include <netinet/in_systm.h> +#include <netinet/ip.h> #include <protocols/dumprestore.h> @@ -121,7 +122,7 @@ rmtgetconn() #endif char *tuser; int size; - int maxseg; + int throughput; if (sp == NULL) { sp = getservbyname("shell", "tcp"); @@ -148,6 +149,8 @@ rmtgetconn() rmt = _PATH_RMT; rmtape = rcmd(&rmtpeer, (u_short)sp->s_port, pwd->pw_name, tuser, rmt, (int *)0); + if (rmtape < 0) + return; size = ntrec * TP_BSIZE; if (size > 60 * 1024) /* XXX */ size = 60 * 1024; @@ -157,10 +160,10 @@ rmtgetconn() setsockopt(rmtape, SOL_SOCKET, SO_SNDBUF, &size, sizeof (size)) < 0) size -= TP_BSIZE; (void)setsockopt(rmtape, SOL_SOCKET, SO_RCVBUF, &size, sizeof (size)); - maxseg = 1024; - if (setsockopt(rmtape, IPPROTO_TCP, TCP_MAXSEG, - &maxseg, sizeof (maxseg)) < 0) - perror("TCP_MAXSEG setsockopt"); + throughput = IPTOS_THROUGHPUT; + if (setsockopt(rmtape, IPPROTO_IP, IP_TOS, + &throughput, sizeof(throughput)) < 0) + perror("IP_TOS:IPTOS_THROUGHPUT setsockopt"); #ifdef notdef if (setsockopt(rmtape, IPPROTO_TCP, TCP_NODELAY, &on, sizeof (on)) < 0) |